Recreate lodash library - drop method

I’m struggling with a question, and I was wondering if you might see the answer easily:

I was working on a project that consists in re-creating the methods in the JavaScript lodash library. The particular issue I have a question about has to do with recreating the drop method, which takes two arguments (an array and a number representing the number of items to drop from the beginning of the array) and returns a new array containing the elements from the original array, excluding the specified number of elements from the beginning of the array. If the number of elements to drop is unspecified, the method should drop one element.

I don’t understand why my code does not work.
Here is my proposal:

drop(array, number) {
return (number ? array.slice(number, array.length) : array.shift());
}

The answer the exercise accepts is:

drop(array, number) {
if (number===undefined) {
number = 1;
} const droppedArray = array.slice(number, array.length);
return droppedArray;
}

I don’t understand why the two pieces of code above don’t amount to the same thing. After all, array.shift() drops the first element if number is undefined, which is the same effect as setting number to 1. Otherwise, if number is defined, the two snippets of code return the same thing.

below a copy of my code:

const _ = {
drop(array, number) {
if (number===undefined) {
number = 1;
} const droppedArray = array.slice(number, array.length);
return droppedArray;
}
};

//BELOW IS THE CODE THAT DOES NOT PASS THE TEST, I DON’T KNOW WHY
drop(array, number) {
return (number ? array.slice(number, array.length) : array.shift());
}

// Do not write or modify code below this line.
module.exports = _;

This is the same question replied to here: