You can use the filter() method to remove null values from a JSON object:
let data = { a: 1, b: 2, c: null };
let newData = data.filter(item => item !== null);
console.log(newData); // { a: 1, b: 2 }
let data={a:20,b:21, c:22, d:null ,e:24}
var dataWithoutNull= data.filter(x=>x!=null);
Note: filter is used to filter out all elements which satisfy the condition;