pull
Mutates the original array to filter out the values specified.
- Use
Array.prototype.filter()
andArray.prototype.includes()
to pull out the values that are not needed. - Set
Array.prototype.length
to mutate the passed in an array by resetting its length to0
. - Use
Array.prototype.push()
to re-populate it with only the pulled values.