Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Windows
Desktop
2 years ago
Benchmark.js
With ternary operator #2
115.4M/s
With ternary operator #1
111.3M/s
With if statements
111.1M/s
With inline statements
108.6M/s
With min() and max()
3.8M/s
View exact numbers
Test name Executions per second
With ternary operator #2 115,374,728 Ops/sec
With ternary operator #1 111,278,360 Ops/sec
With if statements 111,144,248 Ops/sec
With inline statements 108,572,672 Ops/sec
With min() and max() 3,811,978 Ops/sec
Tests: