Watching:

Introduction to variables and data types Programming


show more Variables are containers that can hold practically any type of information in JavaScript. The language is so flexible that programmers can name and define as many unique containers as needed. This allows JavaScript programs to use a wide variety of data types that include numbers and letters. Learn how to create and use JavaScript variables in this introduction to variables and datatypes online video. show less
please wait ...

Introduction to variables and data types

As soon as we write even the simplest program in any programming language, we have to keep track of pieces of information. If we are building a loan calculator, we need to keep track of the amount of the loan, the number of months, the interest rate. If we are writing a game program, we might need to know the current score, the position of the player on the screen, how many lives do we have left, what image do we use for our player. This is all data and we create variables to hold that data.

Variables are simply containers. What we're doing is going out to the computer memory and grabbing a little piece of it, giving it a name to use while our program is running. We grab this space and we name it and then we put a value in it, like an email address or a date or a position or a number, and then we can change that value as we need to. Variables can vary, hence the name. So in JavaScript you create a variable like this.

The word var written all lowercase, which is part of the JavaScript l...

Introduction to variables and data types
Video duration: 5m 16s 4h 47m Beginner

Viewers:

Variables are containers that can hold practically any type of information in JavaScript. The language is so flexible that programmers can name and define as many unique containers as needed. This allows JavaScript programs to use a wide variety of data types that include numbers and letters. Learn how to create and use JavaScript variables in this introduction to variables and datatypes online video.

Subjects:
Developer Web
Author:
please wait ...