0👍
Snapshot.data() is already a Javascript object, your app is rendering it as text since you are printing it in a text element.
Should you still need to convert it from text to an object, you can use JSON.parse(jsonString)
I also highly recommend using typeof snapshot.data()
which will return a string value of its type, in this case "string"
or "Object"
respectfully.
Source:stackexchange.com