Advertisement
nikolayneykov

Untitled

Nov 7th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const arr = [1, 2, 3, 4, 5];
  2.  
  3. const result = arr.filter(x => x % 2 === 1).map(x => ({ number: x }));
  4.  
  5. console.log(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement