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 trialJustin Warren
7,805 PointsConfused about Javascript overall. Quick question: Does the code build on itself? So var apples= 5 at top of screen is
affected by the code that follows it? Example - var apples =5 and then functions/code is written that affects and changes what "apples" is?
Also if anyone has any other good resources to supplement this learning. I just would like to have some very basic foundational knowledge, b/c I feel like I'm watching the videos but it's just not sinking in!
2 Answers
Steven Parker
231,271 PointsIf I understand what you're asking, the nature of code is that variables will get changed during the course of the code. If they don't need to change, the modern practice would be to declare them using "const" instead of "var", which guarantees that they will not change.
There's lots of additional learning material that can be found online, but before you start looking around, consider sticking with your course or track to completion as many times things will suddenly "sink in" in you just continue forward.
Justin Warren
7,805 PointsThanks will do!
Justin Warren
7,805 PointsJustin Warren
7,805 PointsThanks for the response Steven! Yeah I'm in the techdegree program and am chipping away but JavaScript has my head spinning a bit (and a lot more than HTML and CSS for sure). Thanks!
Steven Parker
231,271 PointsSteven Parker
231,271 PointsUnderstandable, as JavaScript is much more about programming than either HTML or CSS, though a few of the more advanced features of CSS do cross the line a bit. Just pace yourself and don't get overwhelmed. Once you get the basics down and start learning about more of the features of the language, I think you'll find it a lot of fun to work with.
Happy coding!