Created
December 21, 2016 18:35
-
-
Save bflannery/2697b06edd176ab8353b8f10adf69bcc 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
// Return the remaining elements of an array after chopping off n elements from the head. | |
// The head means the beginning of the array, or the zeroth index. | |
// (non-mutative) | |
function slasher(arr, howMany) { | |
return arr.slice(howMany); | |
} | |
console.log(slasher([1, 2, 3], 2)); | |
console.log(slasher([1, 2, 3], 0)); | |
console.log(slasher(["burgers", "fries", "shake"], 1)); | |
console.log(slasher([1, 2, 3], 4)); | |
console.log(slasher([1, 2, 3], 9)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment