Filter
π¨βπΌ Great filtering! You've seen how to chain methods for complex queries.
π¦ Method chaining is powerful but can get long. For readability, put each
method on its own line:
const result = products
.filter((p) => p.inStock)
.filter((p) => p.category === 'Electronics')
.filter((p) => p.price < 500)
.map((p) => p.name)
Each line is one transformationβeasy to read and modify.