Simpler yet: (don't tell anyone i extended Object)

Object.prototype.is = function(type){
    return typeof this==type?true:false;
}

On Jun 4, 10:29 pm, jiggliemon <[email protected]> wrote:
> What about having a simple "is" method on all the main 
> types?http://jsfiddle.net/jiggliemon/BDEWf/2/
>
> -Chase

Reply via email to