Related questions
ECMAScript 2015: const in for loops
Which of the two (or neither/ both) code fragments below should be working in a complete ECMAScript 2015 implementation:
for (const e of a)
for (const i = 0; i < a.length; i += 1)
From my understanding, the first example should work because …
How well is the `for of` JavaScript statement supported?
var nameArray = [
{ name: 'john', surname: 'smith' },
{ name: 'paul', surname: 'jones' },
{ name: 'timi', surname: 'abel' },
];
for (str of nameArray) {
console.log( str.name );
}
I want to know, how supported is for( item of array ) in terms of browser support, mobile JavaScript …
Can I yield from an inner function?
With ES6 generators, I see code like this:
var trivialGenerator = function *(array) {
var i,item;
for(var i=0; i < array.length; i++){
item = array[i];
yield item;
};
};
Is it possible to write something more like the code below instead?
…