iterar javascript code example
Example 1: for javascript
var texts = [
'a1',
'a2',
'a3',
];
for (var i = 0; i < texts.length; i++) {
console.log(texts[i]);
}
/* Result
a1
a2
a3
*/
Example 2: what is an iterator in javascript
The iterator is an object that returns values via its method next()