DEV Community

Randy Rivera
Randy Rivera

Posted on

Declaring JavaScript Variables.

Let's start of here. There are eight different data types in JavaScript which are undefined, null, symbol, string, object, and bigint.

Variables allow computers to manipulate and store data. Similar to math (x and y variables), computer variables differ in a way where they can store many different values at any time.

Let's dive right in and tell JavaScript to declare such variable by placing the keyword var in front of it.

* EX:
    var dog;
*  Here we created a variable called dog. We always end statements with semicolons. Variable names can be written up of numbers, letters, and _ or even $ (we'll explain that another time), but it cannot contain spaces or start with a number.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)