Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
Chrome 78
Windows
Desktop
5 years ago
Test name Executions per second
value == null 11374266.0 Ops/sec
value == undefined 4145458.2 Ops/sec
value === null 11401811.0 Ops/sec
value === undefined 4206970.5 Ops/sec
value === null || value === undefined 3120161.5 Ops/sec
_.isNil(value) 3888133.8 Ops/sec
value != null 11381261.0 Ops/sec
value != undefined 4113008.2 Ops/sec
value !== null 11451427.0 Ops/sec
value !== undefined 4214056.5 Ops/sec
value !== null && value !== undefined 3032038.0 Ops/sec
!_.isNil(value) 4120737.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)