Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

removes null and false values from an array

function bouncer(arr) {
 arr = arr.filter(function (n) { 
    return (n !== undefined && n !== null && n !== false && n !== 0 && n !== "" && isNaN()!=NaN); });
  return arr;
}

bouncer([7, "ate", "", false, 9, NaN], "");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #removes #null #false #values #array
ADD COMMENT
Topic
Name
6+8 =