Run details:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
Safari 5
Windows 7
Desktop
3 years ago
Test name Executions per second
value == null 14783857.0 Ops/sec
value == undefined 6022974.0 Ops/sec
value === null 11549179.0 Ops/sec
value === undefined 5909665.0 Ops/sec
value === null || value === undefined 4472211.5 Ops/sec
_.isNil(value) 6446051.0 Ops/sec
value != null 14941534.0 Ops/sec
value != undefined 6097244.0 Ops/sec
value !== null 13465561.0 Ops/sec
value !== undefined 6395789.5 Ops/sec
value !== null && value !== undefined 5068010.0 Ops/sec
!_.isNil(value) 6299773.0 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)