This function removes given values from an array in place as opposed to the native filter function that returns a new array. Doing _values.find is expected to be faster than first converting _values to a local table and then using in for each element in _array. This is because looking up values that don't exist in a table is a slower operation than using find on an array especially at smaller len - which _values is expected to have.
This function removes given values from an array in place as opposed to the native filter function that returns a new array. Doing
_values.find
is expected to be faster than first converting_values
to a local table and then usingin
for each element in_array
. This is because looking up values that don't exist in a table is a slower operation than usingfind
on an array especially at smaller len - which_values
is expected to have.