Trim or remove, empty or null values in array using jquery or javascript

by Francis 2013-08-16 14:18:49

Trim or remove, empty or null values in array using jquery or javascript
1. In Javascript to use filter function to trim empty value from array.


function trimEmpty(n)
{
return(n);
}
array.filter(trimEmpty);



2. In Jquery to use grep function to trim empty value from array.


function trimEmpty(n)
{
return(n);
}
$.grep(array,trimEmpty);

1306
like
0
dislike
0
mail
flag

You must LOGIN to add comments