When will the Javascript “for…of” loop be implemented in Chrome Chrome? [closed]
-
30-04-2021 - |
سؤال
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?
المحلول
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];
...
});
لا تنتمي إلى StackOverflow