Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove null values from json object in javascript

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;
 
PREVIOUS NEXT
Tagged: #remove #null #values #json #object #javascript
ADD COMMENT
Topic
Name
1+5 =