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"];
 
PREVIOUS NEXT
Tagged: #lodash #remove #undefined #values #array
ADD COMMENT
Topic
Name
5+4 =