TZinovieva

Process Odd Numbers JS Fundamentals

Feb 7th, 2023 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function processOddNumbers(arr) {
  2.     let oddNums = arr.filter((num, index) => index % 2 === 1).map(num => num * 2).reverse();
  3.     console.log(oddNums.join(' '));
  4. }
Advertisement
Add Comment
Please, Sign In to add comment