Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
one year ago
Benchmark.js
With if statements
170.5M/s
With inline statements
167.4M/s
With ternary operator #2
164.7M/s
With ternary operator #1
162.2M/s
With min() and max()
6.4M/s
View exact numbers
Test name Executions per second
With if statements 170,454,320 Ops/sec
With inline statements 167,350,832 Ops/sec
With ternary operator #2 164,657,568 Ops/sec
With ternary operator #1 162,206,256 Ops/sec
With min() and max() 6,418,226 Ops/sec
Tests: