vendredi 13 février 2015

How to access this attribute [duplicate]



This question already has an answer here:




I'm new to JavaScript and I've been stuck on this for a little while now. Let's say I have an object inside an array inside an object, like so:



var myCrazyObject = { "name": "A ridiculous object", "some array": [7, 9, { purpose: "confusion", number: 123 }, 3.3], "random animal": "Banana Shark"};


Now I know that I can access the "some array" attribute thusly: myCrazyObject["some array"] So, the part that I'm stuck on is, how do I access the purpose or number attributes?





Aucun commentaire:

Enregistrer un commentaire