The _.remove function does not take a string as the second argument, but a predicate function that is called for each value in the array. If the function returns true , the value is removed from the array.
Lodas doc: https://lodash.com/docs#remove
Removes all elements from the array that the predicate returns the truth for and returns an array of deleted elements. The predicate is associated with thisArg and is called with three arguments: (value, index, array).
So, if you want to remove b from your array, you should do something like this:
var list = ['a', 'b', 'c', 'd'] _.remove(list, function(v) { return v === 'b'; }); ["a", "c", "d"]
source share