Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Chrome 99
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
value == null 17725110.0 Ops/sec
value == undefined 5529581.5 Ops/sec
value === null 18054652.0 Ops/sec
value === undefined 5567282.5 Ops/sec
value === null || value === undefined 4140448.8 Ops/sec
_.isNil(value) 5517728.5 Ops/sec
value != null 16533519.0 Ops/sec
value != undefined 5276038.0 Ops/sec
value !== null 16928892.0 Ops/sec
value !== undefined 5299585.0 Ops/sec
value !== null && value !== undefined 3877182.2 Ops/sec
!_.isNil(value) 5369798.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)