Skip to content

Instantly share code, notes, and snippets.

View nuwansh's full-sized avatar
:electron:

Sameera Hettiarachchi nuwansh

:electron:
View GitHub Profile
@nuwansh
nuwansh / remove_empty_value.js
Created December 31, 2011 06:11
Remove empty elements from an array in Javascript and join it as string
/**This is example works with only jQuery
* @usecase, if you have an array with empty values (ex: ["I", "", "want", "", "to", "go", "" ])
* but you want to return this array as a string.
*/
var myRoom = {
myAction: function(array){
garray = $.grep(array,function(n){
return(n);
});