Module

x/lodash_es/src/array.js>remove

lodash for deno use
Latest
function remove
import { remove } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/array.js";

Removes all elements from array that predicate returns truthy for and returns an array of the removed elements. The predicate is invoked with three arguments: (value, index, array).

Note: Unlike _.filter, this method mutates array. Use _.pull to pull elements from an array by value.

Examples

var array = [1, 2, 3, 4]; var evens = _.remove(array, function(n) { return n % 2 == 0; });

console.log(array); // => [1, 3]

console.log(evens); // => [2, 4]

Parameters

array

The array to modify.

predicate