Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Chrome 136
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
With ternary operator #1
230.7M/s
With if statements
227.1M/s
With inline statements
223.9M/s
With ternary operator #2
218.8M/s
With min() and max()
218.7M/s
View exact numbers
Test name Executions per second
With ternary operator #1 230,738,256 Ops/sec
With if statements 227,076,624 Ops/sec
With inline statements 223,938,224 Ops/sec
With ternary operator #2 218,801,152 Ops/sec
With min() and max() 218,738,512 Ops/sec
Tests: