Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

lodash remove undefined values from array

var colors = ["red",undefined,"","blue",null,"crap"];
// remove undefined, null, "" and any other crap
var cleanColors=_.without(colors,undefined,null,"","crap");
//cleanColors is now ["red","blue"];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #lodash #remove #undefined #values #array
ADD COMMENT
Topic
Name
1+2 =