Lambdas • Lesson 48/100+50 XP

Sequences

Lazy evaluation for collections

📚
Learn
💻
Code
Quiz
🏆
Practice
Complete

📚 Lý thuyết

**Sequences** xử lý collections một cách lazy (theo từng phần tử). **Ưu điểm:** - Hiệu quả với collections lớn - Không tạo intermediate collections - Short-circuit operations **Tạo Sequence:** - collection.asSequence() - sequenceOf(...) - generateSequence { }