Monday, 18 June, 2018 UTC


Summary

For an object to become an iterator it needs to know how to access values in a collection and keeping track of its position in the list. This is achieved by an object implementing a next method and returning the next value in the sequence. This method should return an object containing two properties value and done. It must have the [Symbol.iterator] as well as this is key to using for..of loop.