Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15
Safari 14
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
value == null 19394004.0 Ops/sec
value == undefined 1659433.2 Ops/sec
value === null 14267792.0 Ops/sec
value === undefined 1219760.4 Ops/sec
value === null || value === undefined 993068.7 Ops/sec
_.isNil(value) 1444156.4 Ops/sec
value != null 4235517.5 Ops/sec
value != undefined 1340277.6 Ops/sec
value !== null 4744604.0 Ops/sec
value !== undefined 1360650.4 Ops/sec
value !== null && value !== undefined 1016374.9 Ops/sec
!_.isNil(value) 1517100.9 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)


;