Create a LazyList that cycles through an iterable infinitely
Create an empty LazyList
Create a LazyList from multiple values
Reconstruct a LazyList from a JSON envelope emitted by serialize().toJSON()
or instance toJSON(). Verifies @functype === "LazyList" when the marker
is present (canonical from 1.2.0). The materialized array becomes the new
LazyList's backing — laziness can't survive JSON serialization.
Create an infinite LazyList by repeatedly calling a function
Create an infinite LazyList by repeatedly applying a function
Create a LazyList from a single value
Create a LazyList of numbers from start to end (exclusive)
Create a LazyList that repeats a value n times (or infinitely if n is not provided)
// Process large datasets efficiently
const result = LazyList.range(1, 1000000)
.filter(x => x % 2 === 0)
.map(x => x * x)
.take(5)
.toArray() // [4, 16, 36, 64, 100]
Lazy list implementation for efficient deferred computation