map.has VS in operator

JavaScript performance comparison

Test case created by David Bruant

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var desc = {
      get: function(){},
      configurable: true
    }
   
    var descMap = new Map();
    for(var p in desc){
      descMap.set(p, desc[p])
    }
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
in operator
'configurable' in desc;
'enumerable' in desc;
pending…
map.has
descMap.has('configurable')
descMap.has('enumerable')
pending…

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

Compare results of other browsers

0 comments

Add a comment