js-fns
Version:
Modern JavaScript utility library focused on the build size
19 lines (16 loc) • 333 B
JavaScript
exports.default = remove
/**
* Creates an array without the given element.
*
* @param array - The array to remove the element from
* @param element - The element to remove
*
* @category Array
* @public
*/
function remove(array, element) {
return array.filter(function (el) {
return el !== element
})
}