-
-
Save codecademydev/3b1a06c9cbd25283c65afd52cb5753fc to your computer and use it in GitHub Desktop.
Codecademy export
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
// Write your code here: | |
const reverseArray = () =>{ | |
word = []; | |
newSentence = []; | |
for ( i = 0 ; i < sentence.length ; i++){ | |
word = sentence[i]; | |
newSentence.unshift(word); | |
} | |
return newSentence; | |
} | |
// When you're ready to test your code, uncomment the below and run: | |
const sentence = ['sense.','make', 'all', 'will', 'This']; | |
console.log(reverseArray(sentence)); | |
// Should print ['This', 'will', 'all', 'make', 'sense.'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment