Type of array items
Copy of array without value.
const data = [{ name: `Alice` }, { name:`Sam` }];
// This wouldn't work as expected, because the default comparer uses instance,
// not value:
without(data, { name: `Alice` });
// So instead we can use a value comparer:
without(data, { name:`Alice` }, isEqualValueDefault);
const data = [ { name: `Alice` }, { name:`Sam` }];
without(data, { name:`ALICE` }, (a, b) => {
return (a.name.toLowerCase() === b.name.toLowerCase());
});
Consider remove to remove an item by index.
Returns an array with value(s) omitted.
If value is not found, result will be a copy of input. Value checking is completed via the provided
comparer
function. By default checking whethera === b
. To compare based on value, use theisEqualValueDefault
comparer.