Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134
Windows
Desktop
one year ago
Benchmark.js
With ternary operator #1
122.3M/s
With min() and max()
117.3M/s
With if statements
117.2M/s
With ternary operator #2
115.1M/s
With inline statements
112.0M/s
View exact numbers
Test name Executions per second
With ternary operator #1 122,259,032 Ops/sec
With min() and max() 117,286,736 Ops/sec
With if statements 117,234,816 Ops/sec
With ternary operator #2 115,148,416 Ops/sec
With inline statements 112,032,832 Ops/sec
Tests: