On Fri, Sep 19, 2008 at 9:39 AM, Brendan Eich <[EMAIL PROTECTED]> wrote:
> On Sep 19, 2008, at 10:27 AM, Sam Ruby wrote:
>
>> On Fri, Sep 19, 2008 at 9:21 AM, Brendan Eich <[EMAIL PROTECTED]>
>> wrote:
>>> On Sep 19, 2008, at 8:45 AM, Sam Ruby wrote:
>>>
> We've been around this block on the list. I'm with you: typeof 1.1m
> == "decimal" and we'll take chances with code that thinks it knows
> every result string that typeof might produce.
>
What is the best way to check if a value is numeric?
Existing code that uses:
if(typeof x == "number") { ... }
- could be changed to:-
if(typeof x == "number" || typeof x == "decimal") { ... }
- is this the proposed solution?
ES4 had something like:-
if(x is Number){...}
Thank you,
Garrett
> /be
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss