Build a Custom Iterable Array Class Using the JavaScript Iterator Protocol
Create a custom array-like class that implements the JavaScript Iterator Protocol by defining Symbol.iterator and a next() method. It should be usable in for...of loops, spread syntax, and destructuring. Extend it to support lazy evaluation — values are computed on demand rather than upfront. Implement additional iterator methods like map(), filter(), and take() that return new iterators without materializing the full sequence, making it memory-efficient for large or infinite sequences.