Sample Video Frame

Created by Zed A. Shaw Updated 2026-08-31 20:32:57
 

04: Variables

A variable is a way to give some piece of data in your program a name. This bit gets more complex as you code, but in general you use variables to give data names. The computer really does not care what name you use, but other people care very much. There are many ways to create variables in JavaScript, but we will start with the most recent and easiest to use way. Other ways seem to cause lots of problems and bugs or are difficult to explain now.

With this exercise, keep in mind that you are not really expected to understand what a variable is if you're a beginner. You will, however, get plenty of practice with this concept later.

The Code

View Source file code.js Only

Previous Lesson Next Lesson

Register for The Pro-Webdev Mega Bundle

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.