var Fib = { [Symbol.iterator]() { var n1 = 1; var n2 = 1; return { //make the iterator an iterable [Symbol.iterator]() { return this; }, next() { var current = n1; [n1, n2] = [n2, n1 + n2]; if(current > 10 ) { return { done: true} } return { value: current, done: false}; }, // will get called on break, continue, throw, return return(v) { return { value: v, done: true } } } } };