Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function reverseArray(num , arrayExample){
- let newArray = [];
- for(let i = 0; i < num; i++){
- let currentIndex = arrayExample[i];
- newArray.push(currentIndex);
- }
- newArray.reverse();
- let output = '';
- for(let j = 0; j < newArray.length; j++){
- let currentChar = newArray[j];
- output += ` ${currentChar}`;
- }
- console.log(output);
- }
Advertisement
Add Comment
Please, Sign In to add comment