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