No, the correct way is to use the global function isNaN(x);
See the following comment: http://news.ycombinator.com/item?id=4530557 The reason why some of them is so fast is because the constant expression is evaluated to a constant, so instead of doing a conversion in the test,…
-0+'12' (and 0+'12') doesn't convert it to a number, it converts the zero to a string and then concatenate them to the string "012". And Firefox optimize it: Function('return -0+"12"').toString(); Returns: "function…
The reason why the wicked is so fast in Firefox is because of the literal string and the optimizations done by the compiler. Try this (creates a function and then show the source): Function('return ~~(1 *…
No, the correct way is to use the global function isNaN(x);
See the following comment: http://news.ycombinator.com/item?id=4530557 The reason why some of them is so fast is because the constant expression is evaluated to a constant, so instead of doing a conversion in the test,…
-0+'12' (and 0+'12') doesn't convert it to a number, it converts the zero to a string and then concatenate them to the string "012". And Firefox optimize it: Function('return -0+"12"').toString(); Returns: "function…
The reason why the wicked is so fast in Firefox is because of the literal string and the optimizations done by the compiler. Try this (creates a function and then show the source): Function('return ~~(1 *…