Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
value == null 11427614.0 Ops/sec
value == undefined 4388363.0 Ops/sec
value === null 12408772.0 Ops/sec
value === undefined 4402955.0 Ops/sec
value === null || value === undefined 3191527.5 Ops/sec
_.isNil(value) 4064046.5 Ops/sec
value != null 12567315.0 Ops/sec
value != undefined 4414399.0 Ops/sec
value !== null 12648814.0 Ops/sec
value !== undefined 4493834.5 Ops/sec
value !== null && value !== undefined 3227604.8 Ops/sec
!_.isNil(value) 3944715.8 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)