Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0
Firefox 99
Windows
Desktop
2 years ago
Test name Executions per second
Switch 395.9 Ops/sec
Object Literal 395.3 Ops/sec
If Else 397.9 Ops/sec
Object Literal defined outside function 397.2 Ops/sec
Map 341.7 Ops/sec
Map - defined outsid function 393.6 Ops/sec
If - just for Jason ;P 400.3 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object Literal

  • If Else

  • Object Literal defined outside function

  • Map

  • Map - defined outsid function

  • If - just for Jason ;P