test property exists

Benchmark created on


Setup

const hero = {
  name: 'Batman'
};

Test runner

Ready to run.

Testing in
TestOps/sec
hasOwnProperty
hero.hasOwnProperty('name')
hero.hasOwnProperty('realName')
ready
in
'name' in hero
'realName' in hero
ready
undefined
hero.name === undefined
hero.realName === undefined
ready

Revisions

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