Filter

Filter
πŸ‘¨β€πŸ’Ό The filter method creates a new array with only elements that pass a test.
const numbers = [1, 2, 3, 4, 5]
const evens = numbers.filter((n) => n % 2 === 0)
// [2, 4]
The callback returns true to keep the element or false to exclude it.
🐨 Open
index.ts
and:
  1. Filter products by category
  2. Filter products by price range
  3. Chain filter with map
πŸ’° filter keeps items where your callback returns true.

Please set the playground first

Loading "Filter"
Loading "Filter"
Login to get access to the exclusive discord channel.
Loading Discord Posts