Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Chrome 123
Mac OS X 10.15.7
Desktop
2 years ago
Benchmark.js
With ternary operator #2
182.7M/s
With if statements
177.4M/s
With ternary operator #1
171.2M/s
With inline statements
168.6M/s
With min() and max()
8.7M/s
View exact numbers
Test name Executions per second
With ternary operator #2 182,734,624 Ops/sec
With if statements 177,379,744 Ops/sec
With ternary operator #1 171,189,504 Ops/sec
With inline statements 168,627,248 Ops/sec
With min() and max() 8,712,377 Ops/sec
Tests: