Slide 22
Slide 22 text
function * fruitGen () {
yield '
π
'
yield '
π
'
yield '
π
'
yield '
π₯
'
}
const fruitGenObj = fruitGen()
console.log(fruitGenObj.next()) // { value: '
π
', done: false }
console.log(fruitGenObj.next()) // { value: '
π
', done: false }
console.log(fruitGenObj.next()) // { value: '
π
', done: false }
console.log(fruitGenObj.next()) // { value: '
π₯
', done: false }
console.log(fruitGenObj.next()) // { value: undefined, done: true }
loige 22