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<noob />
17,062 Pointshow the teacher added sarah for example to the classrom set if he didnt declared sarah?
It's not an array of objects, i don't understand how he did it and why it's valid. another question is the syntax of the if statements where is the {}?
2 Answers
Steven Parker
231,269 PointsThe variable "sarah" is declared in the big "let" statement. When items are separated by a comma, it's just like each one was a separate statement with "let" in front of it.
And an "if" can control either a code block (surrounded by braces), or a single statement. The braces aren't needed when the "if" is controlling a single statement.
<noob />
17,062 PointsItβs new to es6? another thing i want to ask is how i continue from here. i decided to do the full stack js track first and then the front end because i find it more interesting. i did all the courses until dom manipulation. we didnβt had any major projects in the new es6 syntax. i also want to be do some algo challenges which i donβt find a lot in the js track like in the python track for example.
Steven Parker
231,269 Points"Let" is new with ES6, but declaring more than one thing at a time using commas is not (it just used to be "var" you would do it with).
There's lots of third-party challenge sites for more practice. One I've used is "codewars".