Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126
Windows
Desktop
2 years ago
Benchmark.js
With if statements
132.4M/s
With ternary operator #1
128.7M/s
With inline statements
126.8M/s
With ternary operator #2
126.4M/s
With min() and max()
4.9M/s
View exact numbers
Test name Executions per second
With if statements 132,401,064 Ops/sec
With ternary operator #1 128,655,528 Ops/sec
With inline statements 126,830,320 Ops/sec
With ternary operator #2 126,355,664 Ops/sec
With min() and max() 4,943,872 Ops/sec
Tests: