Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Chrome 146
Mac OS X 10.15.7
Desktop
5 months ago
Benchmark.js
With ternary operator #1
263.1M/s
With if statements
261.6M/s
With min() and max()
259.6M/s
With ternary operator #2
251.9M/s
With inline statements
245.5M/s
View exact numbers
Test name Executions per second
With ternary operator #1 263,057,472 Ops/sec
With if statements 261,649,552 Ops/sec
With min() and max() 259,584,048 Ops/sec
With ternary operator #2 251,894,992 Ops/sec
With inline statements 245,488,112 Ops/sec
Tests: