Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
Chrome 93
Windows
Desktop
3 years ago
Test name Executions per second
value == null 10085405.0 Ops/sec
value == undefined 3707724.2 Ops/sec
value === null 9906691.0 Ops/sec
value === undefined 3717365.5 Ops/sec
value === null || value === undefined 2695617.5 Ops/sec
_.isNil(value) 3631769.8 Ops/sec
value != null 9881379.0 Ops/sec
value != undefined 3725275.0 Ops/sec
value !== null 9838981.0 Ops/sec
value !== undefined 3719614.2 Ops/sec
value !== null && value !== undefined 2696374.8 Ops/sec
!_.isNil(value) 3727205.2 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • value == null

  • value == undefined

  • value === null

  • value === undefined

  • value === null || value === undefined

  • _.isNil(value)

  • value != null

  • value != undefined

  • value !== null

  • value !== undefined

  • value !== null && value !== undefined

  • !_.isNil(value)