Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Windows
Desktop
2 years ago
Unary + (with NaN)
1040.3M/s
Number (with NaN)
7.1M/s
parseInt (with NaN)
7.0M/s
Unary + (with float)
6.5M/s
Number (with float)
3.4M/s
Unary + (with integer)
3.4M/s
Unary + (with string integer)
3.2M/s
parseInt (with float)
3.1M/s
Number (with integer)
2.3M/s
Number (with string integer)
2.2M/s
parseInt (with integer)
2.2M/s
parseInt (with string integer)
2.2M/s
Unary + (with string float)
2.1M/s
parseInt (with string float)
1.7M/s
Number (with string float)
1.6M/s
View exact numbers
Test name Executions per second
Unary + (with NaN) 1,040,272,320 Ops/sec
Number (with NaN) 7,102,502 Ops/sec
parseInt (with NaN) 7,018,574 Ops/sec
Unary + (with float) 6,534,966 Ops/sec
Number (with float) 3,431,767 Ops/sec
Unary + (with integer) 3,402,229 Ops/sec
Unary + (with string integer) 3,237,634 Ops/sec
parseInt (with float) 3,131,099 Ops/sec
Number (with integer) 2,328,694 Ops/sec
Number (with string integer) 2,218,740 Ops/sec
parseInt (with integer) 2,207,072 Ops/sec
parseInt (with string integer) 2,158,609 Ops/sec
Unary + (with string float) 2,054,027 Ops/sec
parseInt (with string float) 1,749,146 Ops/sec
Number (with string float) 1,580,852 Ops/sec
Tests: