❗iterators only iterate once❗️
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
JS⟩ iteration ⟩ iterator ⟩ only iterate once
iterators only iterate once❗️
💾 replit:only iterate once
// generator function returns "generators"
// - generators are "iterable iterators".
// - iterators only iterate once❗
function* genAB() {
yield 'A';
yield 'B';
}
// main
const ab