JavaScript Iterator Helpers: Lazy map, filter and take
Array methods create a whole new array at each step. Iterator helpers work on iterators instead and are lazy : values are processed one at a time, only as many as you need. The methods iterator.map(fn) iterator.filter(fn) iterator.take(n) iterator.drop(n) iter...