Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const numbers = [3, 1, 4]
- const isEven = x => Promise.resolve(x => x % 2 === 0)
- await Promise
- .all(numbers.map(isEven)))
- .then(results => numbers.filter((_, index) => results[index])) // without conductor
- await filter(isEven, numbers) // with conductor
Add Comment
Please, Sign In to add comment