function reverseArray(arr) {
const newArr = []
for (i = arr.length - 1; i >= 0; i--){
newArr.push(arr[i])
}
return newArr
}
console.log(reverseArray([3, 4, 5]))
Last active
June 17, 2021 04:35
-
-
Save tripdog/47d32e197d7759ac20187d0f885e0616 to your computer and use it in GitHub Desktop.
Write a function that takes an array and returns a new array that's a reverse of the oringinal.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment