1// an empty space between two commas in an array is categorized as a null value
2var array = [0, 1, null, 2, "", 3, undefined, 3,,,,,, 4,, 4,, 5,, 6,,,,];
3// copy the following code snippet and use it anywhere in your own code
4var filtered = array.filter(function (el) {
5 return el != null;
6});
7
8console.log(filtered);
1var s = [ '1,201,karthikeyan,K201,HELPER,karthikeyan.a@limitlessmobil.com,8248606269,7/14/2017,45680,TN-KAR24,8,800,1000,200,300,Karthikeyan,11/24/2017,Karthikeyan,11/24/2017,AVAILABLE\r',
2 '' ]
3var newArr = s.filter(function(entry) { return entry.trim() != ''; })
4
5console.log(newArr);