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

Why isn't } a closing bracket for javascript? The quiz say ; is.

Why isn't } a closing bracket for javascript? The quiz say ; is.

Hi Arthur, what quiz are you referring to?

"Like a period at the end of a sentence" is a key part of that question. } is a closing bracket but it's not like a period at the end of a sentence.

2 Answers

Gotcha! The semicolon is used to separate statements in JavaScripts. So in essence, it acts as the same way a period acts at the end of a sentence. Braces {} in JavaScript have different uses, they enclose blocks of code in a function and are used during the declaration of Object literals to name a few examples. I hope I was able to help!

Got it! Thanks!)

I found that a lot of times (cause I make a lot of mistakes) when JS says something like that, it's an error that is happening prior to that.