I needed a method similar to ruby’s compact
but for javascript.
Here I will describe how to easily do this with pure js.
var my_array = my_array.filter(function(x){
return (x !== (undefined || null || ''));
});
Related External Links:
I needed a method similar to ruby’s compact
but for javascript.
Here I will describe how to easily do this with pure js.
var my_array = my_array.filter(function(x){
return (x !== (undefined || null || ''));
});
Related External Links:
Article Topic:Software Development - Javascript
Date:January 05, 2016
Want me to help develop your next Ruby-on-Rails project or application?
Contact Me