Tell us what’s happening:
Is not that answer right? I am getting an error
Your code so far
var newArr=[];
function slasher(arr, howMany) {
if(howMany>arr.length){
return [];
}
for(var i=howMany; i<arr.length;i++){
newArr[i-howMany]=arr[i];
}
arr=newArr;
return arr;
}
slasher(["burgers", "fries", "shake"], 1);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/slasher-flick