# Javascript Basic Part-1

Variable --&gt; Named storage data

We can declare it using var,let,const

let- new declaration

var - old school side declaration

const- for constant type values you can declare it

### Rules for declaring variable

1.cannot start with number is universal for all language

2.**<mark>let my-name</mark>** hypens <mark> '-'</mark> aren't allowed inthe name

3\. **<mark>john</mark>** and **<mark>JOHN</mark>** are two different variables

4.You can't use reserve keywords to variable name

5.It is possible to use non-latin letters but in the future perspect you need to write in becuase its globally valid for all people.

for eg:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672667399845/09cc6d71-5385-45a2-80bb-48811d76401a.png align="center")

Normally, we need to define a variable before using it,But in old times you can directly declare it without types eg:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672666686576/de618d34-2d08-47ac-a134-ca6e741087af.png align="center")

This above works still now,but its a bad practice ,after ES6 you can use <mark>"use strict"</mark> to avoid it for future declaration errors

let Keyword eg:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672667562180/ad1a1c6b-89f9-4d81-b0da-4c4140675cf3.png align="center")
