Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove undefined from array javascript

var data = [42, 21, undefined, 50, 40, undefined, 9];

data = data.filter(function( element ) {
   return element !== undefined;
});
 
PREVIOUS NEXT
Tagged: #remove #undefined #array #javascript
ADD COMMENT
Topic
Name
7+9 =