Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubylazy enumeratorsSingle-choice MCQ

Why does this lazy enumerator chain terminate instead of running forever?

result = (1..Float::INFINITY) .lazy .map { |n| n * n } .select { |n| n.even? } .first(3) p result