Array Empty Element to remove in javascript using Function

by Prabakaran 2012-07-30 15:49:18

//Method II
function cleanArray(actual){
var newArray = new Array();
for(var i = 0; i if (actual[i]){
newArray.push(actual[i]);
}
}
return newArray;
}

alert(cleanArray([1,2,,3,,3,,,,,,4,,4,,5,,6,,,,]));

711
like
0
dislike
0
mail
flag

You must LOGIN to add comments