Created
July 17, 2017 16:17
-
-
Save ethanstenis/7a977c46dce4de7aab2476682437fdcb to your computer and use it in GitHub Desktop.
This is the solution to Codewars' Kata: My head is at the wrong end.
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 fixTheMeerkat(arr) { | |
var end = arr.shift(); | |
var begin = arr.pop(); | |
arr.push(end); | |
arr.unshift(begin); | |
return arr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or just array.reverse