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
Need help understanding the usage of commas and quotation marks used here in the lesson
I understood you can interchange “ and ‘ (commas and quotation marks) as shown in the video lesson, right? Although to apply best practice you stay consistent, right? If so, I put quotation marks and it doesn’t run my code. What am I not getting about mixing commas and quotation marks used in the video versus me putting quotation marks at the end to be consistent?
Steven Parker228,026 Points
Commas ( , ) cannot be substituted for quotes ( " ), but apostrophes can ( ' also known as a "single quote").
And the code shown above is missing part of the last literal string. There should be something (perhaps just a period) and another apostrophe, and ideally a semicolon all before the "document.write" statement:
sentence += ' the ' + noun + ' // incomplete, unbalanced 's sentence += ' the ' + noun + '.'; // fixed