In postman, I have done in form-data KEY -products VALUE-
[
{ name: "Pizza", price: "10", quantity: "7" },
{ name: "Cerveja", price: "12", quantity: "5" },
{ name: "Hamburguer", price: "10", quantity: "2" },
{ name: "Fraldas", price: "6", quantity: "2" },
];
In code,I want to receive this same array of objects but I can receive it as a string. My code is
var products =req.body.products;
console.log(typeof(products))//string shows
var Products=JSON.parse(JSON.stringify(products))
console.log(typeof(Products))// it also string shows
if I print array 0 index value it prints "[" array bracket Please Help me out I am new in this. Thank you