Core concept
(1 to 5).sum // 15
(0 until 10 by 2).toListAdvertisement
How it works
Lazy: doesn't allocate all elements upfront.
Advertisement
Trade-offs + gotchas
Iteration, ranges in tests, sequence generation.
(1 to 5).sum // 15
(0 until 10 by 2).toListLazy: doesn't allocate all elements upfront.
Iteration, ranges in tests, sequence generation.