var, let and const | scope | uses | in JavaScript

preview_player
Показать описание
var
This was the only var declaration statement before ES6(ECMAScript2015)
The scope of a var variable is functional or global scope.
It can be updated and re-declared in the same scope.
It can be declared without initialization.
let
The scope of a let variable is block scope.
It can be updated but cannot be re-declared in the same scope.
It can be declared without initialization.
const
const variable must be initialized with a Value
const variable can not be re-assigned
const variable will be in uppercase
Рекомендации по теме
welcome to shbcf.ru