CSE 121B: JavaScript Language

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

Check Your Understanding

  1. 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.
  2. Read the instructions in the JavaScript tab starting at the top.
  3. Ponder the questions that are asked as you work through the code and its provided output.