Trim or remove, empty or null values in array using jquery or javascript
by Francis[ Edit ] 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);