|
967 | 967 | | ----------------------------------------------------- | --------------------------- |
|
968 | 968 | | It has been available from the beginning of JavaScript | Introduced as part of ES6 |
|
969 | 969 | | It has function scope | It has block scope |
|
970 | | - | Variable declaration will be hoisted | Hoisted but not initialized | |
| 970 | + | Variable declaration will be hoisted, initialized as undefined | Hoisted but not initialized | |
971 | 971 | | It is possible to re-declare the variable in the same scope | It is not possible to re-declare the variable |
|
972 | 972 |
|
973 | 973 | Let's take an example to see the difference,
|
|
0 commit comments