arr[i]; } } ! ! var arr = ['I', 'l', 'o', 'v', 'e', 'u']; var iterator = generator(arr); ! console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value); console.log(iterator.next().value);