Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36
Chrome 87
Mac OS X 11.0.1
Desktop
4 years ago
Test name Executions per second
value == null 14509775.0 Ops/sec
value == undefined 5275574.0 Ops/sec
value === null 14339256.0 Ops/sec
value === undefined 5298486.0 Ops/sec
value === null || value === undefined 3945579.2 Ops/sec
_.isNil(value) 4923808.5 Ops/sec
value != null 14499553.0 Ops/sec
value != undefined 5171254.5 Ops/sec
value !== null 14486687.0 Ops/sec
value !== undefined 5312081.0 Ops/sec
value !== null && value !== undefined 3956285.0 Ops/sec
!_.isNil(value) 4876123.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)