Good day,
So I'm trying to insert an object to my single javascript json object.
I have this sample result which is called fruits when I enter the value inside console.log(JSON.stringify(fruits))
{"Apple": {"price": 100}, "Banana": {"price": 120}, "Grapefruit": {"price": 300}}
But I need to push or append new fruit which is the Mango
in this result.
What I tried so far is something like this.
fruits.push({"Mango": {"price":350})
console.log(fruits)
But apparently, I'm getting an error.
Any help?