Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
value == null 10789270.0 Ops/sec
value == undefined 3718098.2 Ops/sec
value === null 10799911.0 Ops/sec
value === undefined 3766778.2 Ops/sec
value === null || value === undefined 2825698.8 Ops/sec
_.isNil(value) 3687699.0 Ops/sec
value != null 10752087.0 Ops/sec
value != undefined 3721698.8 Ops/sec
value !== null 10785737.0 Ops/sec
value !== undefined 3778181.0 Ops/sec
value !== null && value !== undefined 2830651.5 Ops/sec
!_.isNil(value) 3688384.5 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)