Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15
Safari 14
Mac OS X 10.15.6
Desktop
4 years ago
Test name Executions per second
value == null 12037350.0 Ops/sec
value == undefined 4051962.2 Ops/sec
value === null 11813121.0 Ops/sec
value === undefined 4080693.0 Ops/sec
value === null || value === undefined 3125335.5 Ops/sec
_.isNil(value) 4717823.5 Ops/sec
value != null 11792466.0 Ops/sec
value != undefined 3997934.8 Ops/sec
value !== null 11912478.0 Ops/sec
value !== undefined 4015783.2 Ops/sec
value !== null && value !== undefined 3136796.2 Ops/sec
!_.isNil(value) 4710217.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)