Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
Chrome 80
Windows
Desktop
4 years ago
Test name Executions per second
value == null 8865328.0 Ops/sec
value == undefined 2755654.0 Ops/sec
value === null 8909463.0 Ops/sec
value === undefined 2756455.5 Ops/sec
value === null || value === undefined 2023034.2 Ops/sec
_.isNil(value) 2741322.2 Ops/sec
value != null 8880043.0 Ops/sec
value != undefined 2721991.0 Ops/sec
value !== null 8860071.0 Ops/sec
value !== undefined 2712700.8 Ops/sec
value !== null && value !== undefined 2008670.6 Ops/sec
!_.isNil(value) 2781063.2 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)