Run details:
Mozilla/5.0 (Android 9; Mobile; rv:66.0) Gecko/66.0 Firefox/66.0
Firefox Mobile 66
Android
Mobile
5 years ago
Test name Executions per second
impicit elementId 140109.1 Ops/sec
explicit getElementById 260190.1 Ops/sec
id function 258450.2 Ops/sec
id var function 258950.0 Ops/sec
id var arrow function 252935.2 Ops/sec
element var 407709.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • impicit elementId

  • explicit getElementById

  • id function

  • id var function

  • id var arrow function

  • element var

  • var element in block scope

  • let element in block scope

  • const element in block scope