Welcome to Blog Site
(1) Difference Between let, var, const
| VAR | LET | CONST | |
|---|---|---|---|
| 1 | The scope of a var variable is functional scope. | The scope of a let variable is block scope. | The scope of a const variable is block scope. |
| 2 | It can be updated and re-declared into the scope. | It can be updated but cannot be re-declared into the scope. | It cannot be updated or re-declared into the scope. |
| 3 | It can be declared without initialization. | It can be declared without initialization. | It cannot be declared without initialization. |
(2) Difference Between Regular function and Errow function
| Regular function | Arrow function | |
|---|---|---|
| 1 | The regular function can easily construct objects. | An arrow function cannot be used as a constructor. |
| 2 | Inside the body of a regular function, arguments is a special array-like object containing the list of arguments with which the function has been invoked. | No arguments special keyword is defined inside an arrow function. |
(2) Difference Between Regular function and Errow function
1) only one pair of quotes (back-ticks). 2) embedded (interpolated) variables and expressions 3) multiple lines within the quotes (pre-formatted text) 4) treated like strings so can be assigned or be a return value