Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36
Chrome 85
Windows
Desktop
4 years ago
Test name Executions per second
value == null 12726038.0 Ops/sec
value == undefined 4548188.5 Ops/sec
value === null 12569872.0 Ops/sec
value === undefined 4505605.0 Ops/sec
value === null || value === undefined 3380119.2 Ops/sec
_.isNil(value) 4575720.0 Ops/sec
value != null 12718717.0 Ops/sec
value != undefined 4498923.0 Ops/sec
value !== null 12620260.0 Ops/sec
value !== undefined 4524203.5 Ops/sec
value !== null && value !== undefined 3400661.2 Ops/sec
!_.isNil(value) 4583002.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)