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;