# JS Variables

The variable is containers for storing the data values.

### Four ways to declare a JS Variable:

\* Var

\* Let

\* Const

\* Using nothing

### Rules of Variables

\- Variable names only start with Characters, underscore & $.

\-Variable names can be alphanumeric. ex:var55.

\-Variable names never start with Numbers or Symbols.

\-Variable not be a reserved keyboard.

<mark>Example:</mark>

```javascript
let name = "Smitha";
let number = 44;
```

### History of (Var, Const & Let):

\-The **var** keyword is used in all JavaScript code from 1995 to 2015.

\-The **let** and **const** keywords were added to Javascript in 2015.

\-If you want your code to run in older browsers, you must use **var.**

### Scope :

The scope is Space under the curly base{}.

## Ways of JS Variables

## var :

**Var** will be alive throughout the code.

```javascript
     var name = "Mike";
```

## let:

**let** alive only inside the scope.

```javascript
    let number = 88;
```

## Const:

Const cannot update the value because of its strong value.

```javascript
     const name = "Rubi";
```
