Run details:
Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Mobile Safari/537.36
Chrome Mobile 99
Android
Mobile
2 years ago
Test name Executions per second
if loop 11768.2 Ops/sec
while + switch/case loop 10296.1 Ops/sec
function + switch/case loop 8297.0 Ops/sec
Script Preparation code:
Tests:
  • if loop

  • while + switch/case loop

  • function + switch/case loop