we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to remove sub array null index in javascript"
Cristina
13 Sep 2016
1var array = [ [ 1, , 2 ], [ 3, , 4 ], [ 5, , 6 ] ];
2
3var filtered = array.filter(function (el) {
4  return el != null;
5});
6
7console.log(filtered);