16 ms·
See the following comment: http://news.ycombinator.com/item?id=4530557 http://news.ycombinator.com/item?id=4530557 The reason why some of them is so fast is be
by some-1 14y ago
See the following comment: http://news.ycombinator.com/item?id=4530557 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, the already converted number is returned.
Use this test instead: http://jsperf.com/parse-number-from-string http://jsperf.com/parse-number-from-string