Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialkaran Badhwar
Web Development Techdegree Graduate 18,135 Pointsarray and objects refer to same variable
The variable questions points to an array or objects. And how about the name, even if we can create an object with the literals, but we still do need a name for them, just like nesting an object inside an object we give that object a key
1 Answer
Steven Parker
231,269 PointsIndividual objects in an array don't need a name, you can access them by indexing the array:
questions[0] // the first object
questions[1] // the next object ... etc.
karan Badhwar
Web Development Techdegree Graduate 18,135 Pointskaran Badhwar
Web Development Techdegree Graduate 18,135 PointsOkay but that's only in arrays right?