Guest User

Untitled

a guest
May 20th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. const numbers = [3, 1, 4]
  2. const isEven = x => Promise.resolve(x => x % 2 === 0)
  3. await Promise
  4. .all(numbers.map(isEven)))
  5. .then(results => numbers.filter((_, index) => results[index])) // without conductor
  6. await filter(isEven, numbers) // with conductor
Add Comment
Please, Sign In to add comment