From the course: JavaScript Essential Training
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Var - JavaScript Tutorial
From the course: JavaScript Essential Training
Var
- [Instructor] In this chapter, we'll take a step back and look at some fundamentals of JavaScript including variables, data types, and various operators. For this purpose, have created the most basic of exercise files, a blank HTML document calling in a single JavaScript file. This gives us a good playground to experiment in the console. We'll start with variables. The classic variable container in JavaScript is simply called var, and it's defined with the var statement. You assign a value to a var by giving it first a name then using the assignment symbol, the equal symbol and then adding a value to it. In the console, I can create a new var by saying var, and then give it a name, container, and then use the equal symbol to assign a value to it. So I'll assign it to value of five. Now I can call in the container at any time and when I do, I get the value. So, five. So I can say container and the browser will…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
Variables: Containers for everything2m 31s
-
(Locked)
Var3m 15s
-
(Locked)
Scope3m 37s
-
(Locked)
Let4m 34s
-
(Locked)
Const2m 58s
-
(Locked)
Data types3m 7s
-
(Locked)
Assignment vs. comparison4m 35s
-
(Locked)
Math operators6m 13s
-
(Locked)
Challenge intro: Calculate sales tax1m 35s
-
(Locked)
Solution: Calculate sales tax3m 30s
-
-
-
-
-
-