Return Part of an Array Using the slice Method, splice not allowed?

Tell us what’s happening:
I’m confused by why this isn’t allowed. It is NOT using the slice method, but is using the splice. Is it just the coding that can’t tell the difference and is not allowing it?

Your code so far

function sliceArray(anim, beginSlice, endSlice) {
  // Add your code below this line
  var newArr = [...anim];
  newArr.splice(0, beginSlice);
  return newArr;

  // Add your code above this line
var inputAnim = ["Cat", "Dog", "Tiger", "Zebra", "Ant"];
sliceArray(inputAnim, 1, 3);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36.

The lesson title is

Return Part of an Array Using the slice Method

And as the point of the lesson is to use slice, not splice, I’m not sure why you’re confused here: you are knowingly doing the wrong thing, so it can’t be a complete surprise that you fail the lesson.

I think the poster might be wanting an explanation of the mechanism that keeps it from working, maybe the way in which fCC could write their testing code to keep the above code from passing, or maybe if the code he or she has given just wouldn’t produce the same result as if they’d used the slice method (though, it actually does return the same result in main test case).