Script Preparation code:
AخA
 
var props = {a:1,b:1,c:1,d:1,e:1,f:1,g:1,h:1,i:1,j:1,k:1,l:1,m:1,n:1,o:1,p:1,q:1,r:1,s:1,t:1,u:1,v:1,w:1,x:1,y:1,z:1};
Tests:
  • hasOwnProperty

    x
     
    var hasKeys = false;
    for (var key in props) {
      if (props.hasOwnProperty(key)) {
        hasKeys = true;
        break;
      }
    }
  • Object.keys

     
    var hasKeys = Object.keys(props).length > 0
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    hasOwnProperty
    Object.keys

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
Safari 16 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
hasOwnProperty 14439438.0 Ops/sec
Object.keys 11806307.0 Ops/sec