A lazy iterator in JavaScript is typically a generator that yields values on demand instead of building a full collection up front. It saves memory and avoids unnecessary work, especially for large or infinite sequences.
Lazy iterators delay computation until values are requested, processing one element at a time. This is critical for large or infinite data sets because it avoids loading everything into memory. For example, a Fibonacci sequence generator using an iterator only computes the next number when next() is called, not all numbers upfront.
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience