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

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

nathaniel marquez
seal-mask
.a{fill-rule:evenodd;}techdegree
nathaniel marquez
Full Stack JavaScript Techdegree Student 2,145 Points

What is the purpose of the first ' [' + <--- first addition symbol questions + 'questions left]';

im aware of the + symbols usage and purpose not sure why its being used before the variable in the concatenation process.

2 Answers

Ryan S
Ryan S
27,276 Points

Hi Nathaniel,

The goal was to begin the string with the opening square bracket '[' character. So that would be the first character in the string, then add the questions variable, then finish the string by adding ' questions left]'. So it's basically just a 3 part string that needs to be concatenated.