Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36
Chrome 83
Mac OS X 10.15.3
Desktop
4 years ago
Test name Executions per second
undefined w/ type 15271710.0 Ops/sec
undefined w/o type without type check 15552280.0 Ops/sec
typeof equal to 14888440.0 Ops/sec
typeof equal to without type check 15398090.0 Ops/sec
with brackets around typeof unequal 15779730.0 Ops/sec
with brackets around typeof equal 15900120.0 Ops/sec
with brackets around typeof unequal with type check 15793000.0 Ops/sec
with brackets around typeof equal with type check 15503660.0 Ops/sec
Script Preparation code:
Tests:
  • undefined w/ type

  • undefined w/o type without type check

  • typeof equal to

  • typeof equal to without type check

  • with brackets around typeof unequal

  • with brackets around typeof equal

  • with brackets around typeof unequal with type check

  • with brackets around typeof equal with type check