Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Chrome 104
Windows
Desktop
2 years ago
Test name Executions per second
value == null 17021998.0 Ops/sec
value == undefined 5917035.5 Ops/sec
value === null 17591448.0 Ops/sec
value === undefined 5764757.5 Ops/sec
value === null || value === undefined 4327954.5 Ops/sec
_.isNil(value) 5486221.0 Ops/sec
value != null 16778902.0 Ops/sec
value != undefined 5811291.5 Ops/sec
value !== null 17074720.0 Ops/sec
value !== undefined 5923638.5 Ops/sec
value !== null && value !== undefined 4239986.0 Ops/sec
!_.isNil(value) 5513589.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)