Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Chrome 79
Windows
Desktop
4 years ago
Test name Executions per second
Switch 33297.6 Ops/sec
Object Literal 35458.8 Ops/sec
Object literals with arrow funcion 33544.5 Ops/sec
Object literals with funcion (from the link in description) 33165.5 Ops/sec
Script Preparation code:
Tests:
  • Switch

  • Object property

  • Object with arrow funcion

  • Object with funcion (from the link in description)