hasOwnProperty vs in vs undefined (v30)

Revision 30 of this benchmark created on


Setup

var Iobj = {
      SUPPORT_ACTIONS: 0x1
    };
    var obj = {
      actions: true,
      support: Iobj.SUPPORT_ACTIONS
    };
    var undefined;

Test runner

Ready to run.

Testing in
TestOps/sec
hasOwnProperty
if (obj.hasOwnProperty("actions")) {
  return true;
}
ready
in
if ("actions" in obj) {
  return true;
}
ready
undefined
 
ready
undefined cmp
 
ready
binary indicator
 
ready
undefined cmp (dynamic)
 
ready
undefined dynamic
 
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.