Advertisement
Spocoman

05. Process Odd Numbers

Feb 6th, 2022
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function processOddNumbers(input) {
  2.     let arr = [];
  3.  
  4.     for (let i = 1; i < input.length; i += 2){
  5.             arr.push(input[i] * 2);
  6.     }
  7.     console.log(arr.reverse().join(' '));
  8. }
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement