Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
value == null 27261468.0 Ops/sec
value == undefined 9547539.0 Ops/sec
value === null 27264536.0 Ops/sec
value === undefined 9579219.0 Ops/sec
value === null || value === undefined 7095099.5 Ops/sec
_.isNil(value) 8868270.0 Ops/sec
value != null 27130790.0 Ops/sec
value != undefined 9498780.0 Ops/sec
value !== null 27087022.0 Ops/sec
value !== undefined 9516650.0 Ops/sec
value !== null && value !== undefined 7056258.5 Ops/sec
!_.isNil(value) 8833412.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)