Last active
August 13, 2018 19:53
-
-
Save AlfieDarko/12002d4ae7560ecd599d8de9a2b88853 to your computer and use it in GitHub Desktop.
reverse_mutation.js
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
let first6Months = ["Jan", "Feb", "March", "April", "May", "June"] | |
console.log(first6Months) | |
// Expected output: [ "June", "May", "April", "March", "Feb", "Jan" ] | |
let first6MonthsClone | |
first6MonthsClone = first6Months.reverse() | |
console.log(first6Months) | |
// Expected output: ["Jan", "Feb", "March", "April", "May", "June"] | |
let first6MonthsClone2 | |
first6MonthsClone2 = first6Months.reverse().pop() | |
console.log(first6MonthsClone2) | |
// Expected output: "Jan" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment