Javascript Basic Part-1

Variable --> 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.let my-name hypens '-' aren't allowed inthe name

3. john and JOHN 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:

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

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

let Keyword eg: