This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

Access Array Values

// create myJSON
const myJSON = '{"name":"John", "age":30, "cars":["Ford", "BMW", "Fiat"]}';

// create myObj from myJSON
const myObj = JSON.parse(myJSON);

// display myObj.car[0]
document.getElementById("demo").innerHTML = myObj.cars[0];