Object membership check speed

Benchmark created by Infinity on


Preparation HTML

<script>
  var obj = {
   'apples': 1,
   'bananas': 1
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
in keyword
'apples' in obj;

'not_here' in obj;

'bananas' in obj;
ready
dot syntax
obj.apples;
obj.not_here;
obj.bananas;
ready
array syntax
obj['apples'];
obj['not_here'];
obj['bananas'];
ready

Revisions

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