Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Windows 7
Desktop
one year ago
Test name Executions per second
Switch 193878.8 Ops/sec
Object Literal 152655.4 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object Literal