You can do something already (in 1.3): Type.isNumber('foo') // returns
false
In 1.2 you can use String.type('foo') // returns true.

These functions are not documented... so the best way is just to stick
with $type (1.2) or typeOf (1.3)

On 5 jun, 08:16, jiggliemon <[email protected]> wrote:
> 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