Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

lodash remove multiple items from array

var colors = ["red","blue","green","yellow"];
var removedColors = _.remove(colors, function(c) {
    //remove if color is green or yellow
    return (c === "green" || c === "yellow"); 
});
//colors is now ["red","blue"]
//removedColors is now ["green","yellow"]
 
PREVIOUS NEXT
Tagged: #lodash #remove #multiple #items #array
ADD COMMENT
Topic
Name
8+7 =