Answers for "lodash remove multiple items from array"

0

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"]
Posted by: Guest on November-06-2019

Code answers related to "lodash remove multiple items from array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language