Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.60.742.918 Safari/537.36
Chrome 122
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
With ternary operator #1
199.3M/s
With if statements
186.1M/s
With inline statements
180.8M/s
With ternary operator #2
177.0M/s
With min() and max()
6.7M/s
View exact numbers
Test name Executions per second
With ternary operator #1 199,280,400 Ops/sec
With if statements 186,103,040 Ops/sec
With inline statements 180,756,432 Ops/sec
With ternary operator #2 176,991,984 Ops/sec
With min() and max() 6,745,738 Ops/sec
Tests: