Number() vs parseInt() and === VS string === (v73)

Revision 73 of this benchmark created by Mario Karagiorgas on


Test runner

Ready to run.

Testing in
TestOps/sec
Number Constructor and compare
Number("101") === 101
ready
parseInt and lenient comparison
parseInt("101") === 101
ready
string comparison of string and integers
"101" == 101
ready
string comparison of numbers
"101" === "101"
ready
lenient comparison of integers
101 == 101
ready
Convert to string and comparison
"101" === 101 + ''
ready
First arg to string and compare
101 + '' === '101'
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.