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 inline statements
172.0M/s
With if statements
170.8M/s
With ternary operator #2
167.0M/s
With ternary operator #1
166.3M/s
With min() and max()
157.0M/s
View exact numbers
Test name Executions per second
With inline statements 172,035,792 Ops/sec
With if statements 170,763,968 Ops/sec
With ternary operator #2 166,984,944 Ops/sec
With ternary operator #1 166,284,832 Ops/sec
With min() and max() 156,957,248 Ops/sec
Tests: