Variables
Overview
Variables are used to store data / values. These values can be primitive like a number, string, Boolean, or null or they can be objects like a function, class, or literal object. The values can be used as input to expressions, used in processing, or used in output to display information.
To give you a better understanding of how JavaScript works, core features and control
structures
of the language are provided throughout the course, including variables. It's worth noting
that these programming structures and concepts are common to all programming
languages. These should be a review of what you have already learned in the pre-requisite
courses.
Prepare
- Read the section on JavaScript variables: 📄JavaScript Basics - Variables - MDN Web Docs.
- Read: 📄Variables - Understanding Variables in JavaScript? - WDD Learning Modules
Check Your Understanding
- Open up this CodePen ⚙️JavaScript
Variables.
You might consider creating your own free CodePen account to use to store snippets of code. CodePen provides a web-based code editor where you can write HTML, CSS, and JavaScript code and see the live results in real-time.
- Read the instructions in the JavaScript tab starting at the top.
- Ponder the questions that are asked as you work through the code and its provided output.