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 trialcyber voyager
8,859 PointsWhy do we use the double {{}} brackets?
Null
2 Answers
Steven Parker
231,275 PointsIt's just a notation for where a variable value should be substituted.
They could have picked anything, but double brackets are both reasonably concise yet very unlikely to be found in HTML code otherwise.
Akash Sharma
Full Stack JavaScript Techdegree Student 14,147 PointsIt is a templating framework (called Handlebars) for dynamic HTML so you can pass the data from your javascript files.
Steven Parker
231,275 PointsIn this case, it's not "handlebars" but some custom code that uses similar tokens.
cyber voyager
8,859 Pointscyber voyager
8,859 PointsThank you Steven
Zhenghao He
Courses Plus Student 2,389 PointsZhenghao He
Courses Plus Student 2,389 Pointswhy not using literal template by sing bracket instead of double brackets? would't that be more concise?
Steven Parker
231,275 PointsSteven Parker
231,275 PointsYou could use any notation you like. This example was probably chosen to be more distinct from the placeholders in template strings.