number cast

Benchmark created on


Setup

const str = '15'

Test runner

Ready to run.

Testing in
TestOps/sec
number constructor
Number(str) + 5
ready
+
(+str) + 5
ready
+ with bitwise
((+str) | 0) + 5
ready
+ with double bitwise
((+str) | 0)+(5 | 0)
ready
+ with fully bitwise
(((+str) | 0)+(5 | 0)|0)
ready

Revisions

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