for in vs for of vs for of Iterator
JavaScript performance comparison
Info
Check performance of for in and for of constructs. Firefox only
Preparation code
<script>
Benchmark.prototype.setup = function() {
var a = [5,6,7,8];
a.foo = 'bar';
var c;
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
for in |
|
pending… |
for of |
|
pending… |
for of iterator |
|
pending… |
for in arr |
|
pending… |
for of arr |
|
pending… |
for of iterator |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published
- Revision 3: published by Simon
0 comments