Collections • Lesson 27/100
Filtering & Mapping
Transform and filter collections
📚
Learn💻
Code❓
Quiz🏆
Practice⭐
Complete📚 Lý thuyết
**filter** và **map** là 2 operations quan trọng nhất:
**filter { predicate }**
- Giữ lại phần tử thỏa điều kiện
- filterNot { } - ngược lại
- filterNotNull() - loại bỏ null
**map { transform }**
- Biến đổi mỗi phần tử
- mapNotNull { } - loại null sau transform
- mapIndexed { index, value -> }