Script Preparation code:
AخA
 
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
Tests:
  • undefined

     
    if(undefined !== obj['d']){}
  • typeof

     
    if('undefined' !== typeof obj['d']){}
  • in

     
    if('d' in obj){}
  • hasOwnProperty

     
    if(obj.hasOwnProperty( 'd' )){}
  • bool

     
    if(!!obj['d']){}
  • Undefined2

     
    if(obj['d']!==undefined){}
  • undefined3

     
    if(obj['d']!=undefined){}
  • undefined4

     
    if(obj['d']==undefined){}
  • bool2

     
    if(obj['d']){}
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    undefined
    typeof
    in
    hasOwnProperty
    bool
    Undefined2
    undefined3
    undefined4
    bool2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Firefox 79 on Windows
View result in a separate tab
Test name Executions per second
undefined 91090528.0 Ops/sec
typeof 219349440.0 Ops/sec
in 132360544.0 Ops/sec
hasOwnProperty 131976752.0 Ops/sec
bool 219486352.0 Ops/sec
Undefined2 95855224.0 Ops/sec
undefined3 96450120.0 Ops/sec
undefined4 96566920.0 Ops/sec
bool2 233647312.0 Ops/sec