Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When will the Javascript "for...of" loop be implemented in Chrome Chrome? [closed]

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?

like image 602
Lloyd Avatar asked Feb 16 '12 21:02

Lloyd


1 Answers

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];
    ...

});
like image 194
Raynos Avatar answered Nov 02 '22 05:11

Raynos