In JavaScript there are many different types of variables.

The types are listed below:

String: This stores words, letters, sentences, even numbers and anything else that is in quotes.

Number: This stores numbers. This includes whole numbers and decimal numbers.

Boolean: This is a value that is true or false. 1 or 0.

Undefined: This is a variable that has been created, but no value assigned

Null: this is a variable that has been assigned a value of nothing. It’s not zero, as it’s an absence of any value. However, it’s at least assigned null.

Those are the basic variables. There is a second set of variables that are a little more complicated. These being “Object” variables.

There are 3 main object variables in JavaScript.

Object: A variable that can store many values such as a JSON file (Java Script Object Notation). This is essentially a way to store and notate all kinds of data such as strings, numbers and more in a key and value pair. There will be a lot more info on JSON in upcoming posts.

Array: Arrays are also stores of data, but in a more simpler layout. However you can have multi-dimensional arrays. Or a x and y array.

Date: Dates are objects as they keep more info than just the date. It includes the date, time and time zone.

Now that you have the data types for variables, how do we create them?

Congratulations! You have leveled up in programming!

Next – Javascript 3 – Creating Variables

Previous – JavaScript – Introduction

Leave a Reply

Your email address will not be published. Required fields are marked *