Created
July 11, 2015 07:59
-
-
Save alexeisavca/fa409dc940c30361e7df to your computer and use it in GitHub Desktop.
JS head and tail
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 head(arr){ | |
return arr.slice(0, 1); | |
} | |
function tail(arr){ | |
return arr.slice(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment