var arr = [0, 1, '', '', 3]; arr = arr.filter(function(n){ return n.length > 0}); output: arr = [0,1,3];