Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
Firefox 98
Linux
Desktop
2 years ago
Test name Executions per second
Switch 105174.6 Ops/sec
Object Literal 104772.4 Ops/sec
If Else 105005.8 Ops/sec
Object Literal defined outside function 104791.6 Ops/sec
Map 98982.1 Ops/sec
Map - defined outsid function 98411.4 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object Literal

  • If Else

  • Object Literal defined outside function

  • Map

  • Map - defined outsid function