Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130
Windows
Desktop
one year ago
Benchmark.js
With inline statements
197.4M/s
With ternary operator #2
182.6M/s
With if statements
178.8M/s
With ternary operator #1
177.3M/s
With min() and max()
7.0M/s
View exact numbers
Test name Executions per second
With inline statements 197,382,992 Ops/sec
With ternary operator #2 182,574,416 Ops/sec
With if statements 178,808,192 Ops/sec
With ternary operator #1 177,274,000 Ops/sec
With min() and max() 7,037,248 Ops/sec
Tests: