Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(arr){
- let arrNew = [];
- for (const index in arr) {
- if (index % 2 == 1){
- arrNew.push(arr[index]*2);
- }
- }
- console.log(arrNew.reverse().join(' '));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement