Question

I just coded a function using the Javascript for...of loop, assuming it had been implemented in Chrome (as in Firefox 13).. It has not.

Does anyone know where i can find out if, and when it is scheduled for implementation?

Was it helpful?

Solution

When ES6 lands. for ... of is a proposed feature of ES6.

ES6 should land in 2014 if you're lucky.

As for what you should use today, try

array.forEach(function (value) {
    ...
});

Or

Object.keys(object).forEach(function (key) {
    value = object[key];
    ...

});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top