JavascriptオブジェクトをJSON文字列に変換する stringify
const data = {
vege: "tomate",
price: 1000
};
const myJson = JSON.stringify(data);
console.log(data); // Object {"vege":"tomate","price":1000}
console.log(myJson); // {"vege":"tomate","price":1000}const data = {
vege: "tomate",
price: 1000
};
const myJson = JSON.stringify(data);
console.log(data); // Object {"vege":"tomate","price":1000}
console.log(myJson); // {"vege":"tomate","price":1000}