Accessing Json Data

[Solved] Accessing Json Data | Vb - Code Explorer | yomemimo.com
Question : Accessing JSON Data

Answered by : samer-saeid

// JSON object
const data = { "name": "John", "age": 22, "hobby": {	"reading" : true,	"gaming" : false,	"sport" : "football" }, "class" : ["JavaScript", "HTML", "CSS"]
}
// accessing JSON object
console.log(data.name); // John
console.log(data.hobby); // { gaming: false, reading: true, sport: "football"}
console.log(data.hobby.sport); // football
console.log(data.class[1]); // HTML

Source : | Last Update : Sun, 29 May 22

Answers related to accessing json data

Code Explorer Popular Question For Vb