hasOwnProperty vs in vs undefined (v31)

Revision 31 of this benchmark created on


Setup

var obj = {
      action: true
    };

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
bool (dynamic)
if (obj["actions"]) {
  return true;
}
ready

Revisions

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