Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
value == null 27109786.0 Ops/sec
value == undefined 9532402.0 Ops/sec
value === null 27028976.0 Ops/sec
value === undefined 9567169.0 Ops/sec
value === null || value === undefined 7119672.5 Ops/sec
_.isNil(value) 9162009.0 Ops/sec
value != null 26468662.0 Ops/sec
value != undefined 9493229.0 Ops/sec
value !== null 26704094.0 Ops/sec
value !== undefined 9449550.0 Ops/sec
value !== null && value !== undefined 7012372.5 Ops/sec
!_.isNil(value) 9023728.0 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)