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!

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 trial

JavaScript JavaScript Basics (Retired) Working With Numbers The Mad Libs Challenge Revisited

single quotes outside wrapping square brackets

I worked through this lesson and everything makes sense except the funky single quotes surrounding the opening square bracket and then again outside the closing bracket on the questionsLeft variable throughout the script. I don't understand what they're doing there? Check out lines 2, 5, and 8. Anyway if someone could help me understand what the purpose is that would be great! https://w.trhou.se/26gx4yla5o

1 Answer

The brackets aren't part of the code in this instance. They're a part of the string that will print something like this [3 questions left]

so the brackets are just there to help separate things visually?

Yes, it's to format the output a certain way for the user. This was the Teacher's personal preference but you can do something else if you want.