In this article you will learn:
The latest ECMAScript(ES6) standard defines seven data types out of which six data types are Primitive(predefined).
- Numbers: 5, 6.5, 7 etc.
- String: “Hello World” etc.
- Boolean: Has two values: true or false.
- Null: This type has only one value : null.
- Undefined: A variable that has not been assigned a value is undefined.
- The value stored in a variable can be changed during program execution.
- A variable is only a name given to a memory location, all the operations done on the variable effects that memory location.
let a = 3; a = 4; // works just fine.
Const is variable type is used when you want value of that variable would never change.
const name = 'Paul'; name = 'Thom'; // will give an error.