Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Firefox 134
Windows
Desktop
one year ago
Benchmark.js
With ternary operator #1
1201.5M/s
With ternary operator #2
1156.0M/s
With if statements
1140.6M/s
With min() and max()
1140.5M/s
With inline statements
1139.1M/s
View exact numbers
Test name Executions per second
With ternary operator #1 1,201,516,416 Ops/sec
With ternary operator #2 1,155,996,800 Ops/sec
With if statements 1,140,608,384 Ops/sec
With min() and max() 1,140,537,344 Ops/sec
With inline statements 1,139,116,672 Ops/sec
Tests: