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
mon Wil2,007 Points
what would the answer be for the quiz of creating a new variable name for [blank shipsLeft = 10 ] thanks
Hi, to create a variable you should use one of these keywords- var, let or const. In that quiz, you can choose one of them as an answer.
In general, there are some differences between them. I wrote the main differences for you. Please check this article for more details.
- var - can be updated and re-declared. Likely to cause a lot of bugs in your code.
- let - can be updated but not re-declared.
- const - cannot be updated or re-declared.
So stick with let and const at your project to prevent unexpected errors.