i want to parse the following kind of data in the node js in order to perform operations on them. the data :-
{"orderSummary":[ {
"name":"Wine",
"ProductPrice":"500",
"ProductQuantity":"2",
"ProductCost":"1000",
"SellerId":"2"
},{
"name":"Whisky",
"ProductPrice":"500",
"ProductQuantity":"2",
"ProductCost":"1000",
"SellerId":"2"
}]
}
here is my code snippet which iam using to parse the data :-
router.post('/createorder',function(req,res){
console.log(req.body);
var data=req.body;
var obj=JSON.parse(data);
res.send(obj);
});
can anybody tell me what i can do besides looping (as i will implement it ) in order to parse the data and perform operations on it ?