Skip to content

Instantly share code, notes, and snippets.

  • Save anonymous/7a6938f8024621b43f39 to your computer and use it in GitHub Desktop.
Save anonymous/7a6938f8024621b43f39 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/v3rse 's solution for Bonfire: Slasher Flick
// Bonfire: Slasher Flick
// Author: @v3rse
// Challenge: http://www.freecodecamp.com/challenges/bonfire-slasher-flick?solution=function%20slasher(arr%2C%20howMany)%20%7B%0A%20%20%2F%2F%20it%20doesn%27t%20always%20pay%20to%20be%20first%0A%20%20%20arr.splice(0%2ChowMany)%3B%0A%20%20return%20arr%3B%0A%7D%0A%0Aslasher(%5B1%2C%202%2C%203%5D%2C%202)%3B%0A
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function slasher(arr, howMany) {
// it doesn't always pay to be first
arr.splice(0,howMany);
return arr;
}
slasher([1, 2, 3], 2);
@v3rse
Copy link

v3rse commented Nov 24, 2015

Read docs properly this time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment