Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15
Safari 15
Mac OS X 10.15.6
Desktop
2 years ago
Test name Executions per second
value == null 20849552.0 Ops/sec
value == undefined 7249857.0 Ops/sec
value === null 20939916.0 Ops/sec
value === undefined 7212998.5 Ops/sec
value === null || value === undefined 5473695.0 Ops/sec
_.isNil(value) 7972913.0 Ops/sec
value != null 20812602.0 Ops/sec
value != undefined 7255062.0 Ops/sec
value !== null 20951258.0 Ops/sec
value !== undefined 7236082.0 Ops/sec
value !== null && value !== undefined 5478713.0 Ops/sec
!_.isNil(value) 7944374.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)