Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
With ternary operator #1
165.9M/s
With ternary operator #2
165.1M/s
With if statements
162.4M/s
With inline statements
157.9M/s
With min() and max()
153.7M/s
View exact numbers
Test name Executions per second
With ternary operator #1 165,927,936 Ops/sec
With ternary operator #2 165,053,248 Ops/sec
With if statements 162,359,088 Ops/sec
With inline statements 157,923,776 Ops/sec
With min() and max() 153,720,976 Ops/sec
Tests: