Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Chrome 83
Linux
Desktop
4 years ago
Test name Executions per second
Math.max/min 280735.5 Ops/sec
if 300156.6 Ops/sec
ternary 303150.5 Ops/sec
bitwise 436770.2 Ops/sec
& ~~ 427955.0 Ops/sec
lodash clamp 388672.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Math.max/min

  • if

  • ternary

  • bitwise

  • & ~~

  • lodash clamp


;