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

Revision 85 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Number
Number("101") === 101
ready
parseInt
parseInt("101") === 101
ready
"101" == 101
"101" == 101
ready
"101" === "101"
"101" === "101"
ready
101 == 101
101 == 101
ready
'101' === 101 + ''
'101' === 101 + ''
ready
101 + '' === '101'
101 + '' === '101'
ready
Math.floor("101") == Math.floor(101)
Math.floor("101") == Math.floor(101)
ready
parseInt("101") == parseInt(101)
parseInt("101") == parseInt(101)
ready

Revisions

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