Created
January 11, 2021 11:01
-
-
Save pitsanujiw/a792be506ab5e76f7b1dbc0bd74d170d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reverse(nums) { | |
if (!nums) return; | |
let newList = []; | |
for (let i = nums.length -1; i >= 0; i--) { | |
newList.push(nums[i]); | |
} | |
return newList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment