Answers for "js remove null positions of array"

5

remove null from array javascript

let array = [0, 1, null, 2, 3];

function removeNull(array) {
return array.filter(x => x !== null)
};
Posted by: Guest on June-19-2020
0

how to remove sub array null index in javascript

var array = [ [ 1, , 2 ], [ 3, , 4 ], [ 5, , 6 ] ];

var filtered = array.filter(function (el) {
  return el != null;
});

console.log(filtered);
Posted by: Guest on December-01-2020

Code answers related to "js remove null positions of array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language