can someone explain me what this method con do:
drop()takes two arguments: an array and a number representing the number of items to drop from the beginning of the array
.drop()returns a new array which contains 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, your method should drop one element
When you’ve ideated a game plan for how to implement this functionality, move on to the next step to see how we plan to do it.
Ideate : Let’s come up with a game plan for implementing this method.
- Add the
.drop()method to the lodash object.
- Check to see if the number of items to drop was set. If not, set the number equal to
- Create a new copy of the original array with the specified number of elements dropped from the beginning of the array. We will use the array
.slice()method to accomplish this.
- Return the modified copy of the array from the method.
Once you have tried implementing this game plan in code, move on to the next step to see how we do it