Remove all falsy values from an array

You can use Boolean :

var myFilterArray = myArray.filter(Boolean);

Leave a Comment