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 trialDakota Sexton
1,077 PointsI'm confused. Huston types 'circles', not 'circle', into the console. Shouldn't 'circle' always remain singular?
In the data binding lesson, Huston talks about creating an svg circle for every data point in the databinding.html doc. However, when he demonstrates how to double-check the data in the javascript console, he very explicitly types 'circles.' Am I missing something? Shouldn't 'circle' always be singular?
2 Answers
Steven Parker
231,269 PointsHe explains this is known as a "ghost selection" which is empty since there are (initially) no elements of that type. While his use of "circles" may have been accidental, if I understand what is happening he could potentially use ANY identifier that does not already exist.
Stephen Emery
14,384 PointsYou are right, the code he writes will fail. If you run 'viz.selectAll('circle') you will see the array he's talking about.