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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Zherui Li](https://secure.gravatar.com/avatar/3b85b459895f705156250c9452dfc7d5?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Zherui Li
993 Pointsthe Meaning of '['questions+'questions left]'???
I saw someone said to treat '[' and ']' as strings, but if you write the code like : questions+questions left']' . It doesn't work!
could someone give me the official solution about this issue??
4 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
231,072 PointsThat's only part of the code line. The entire line is:
var questionsLeft = ' [' + questions + ' questions left]';
This creates a string that has brackets in it (assuming you already have a variable named questions), which will be printed out later. Anything enclosed in quotes is a string.
Brackets by themselves (not in a string) are used for indexing. I expect that will be covered later in the course.
![Kevin Baxter](https://secure.gravatar.com/avatar/0db5d409c98bbbf94ce4b69142d7badb?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Kevin Baxter
5,599 PointsOmg I totally get it now I was looking at the quotes in the wrong way.
![y1n5](https://secure.gravatar.com/avatar/8654fa354d464c8e6b31c64443f686e3?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
y1n5
2,626 PointsThanks Steven and all; this was not clear in the lecture. The pink is perfect and helps to see!
![Sven Harder](https://secure.gravatar.com/avatar/af9f8bdb12402147ae64ff037f249dee?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Sven Harder
14,943 Pointsquestions left is a string and a part of the sentence -> it must be inside of quotes. Only questions is outside of the quotes, because it's a variable.
Zherui Li
993 PointsZherui Li
993 PointsThank you Steven, but if I treat it as string, and put the third quote just in front of the second bracket like this
var questionsLeft = ' [' + questions + questions left ' ] '; this code doesn't work anymore. why?