Variable and Parameter
Keyword
Scope
IsMutable
if (true) {
let a = 40;
console.log(a); // 40
}
console.log(a); // undefined.const DOB = '10.05.1998';
DOB = '13.05.1998'; // error, can't reassign the constant
const Languages = ['Python', 'C#'];
Languages = "Java"; // error
Languages.push("JavaScript"); // correct
console.log(Languages); // ['Python', 'C#', 'JavaScript']let a = 50; let b = 100;
if (true) {
let a = 60;
var c = 10;
console.log(a/c); // 6
console.log(b/c); // 10
}
console.log(c); // 10
console.log(a); // 50Destructuring
Destructuring Arrays
Destructuring Objects
default parameters
Rest Parameter (is like varargs)
Spread Parameter
Template Literals
Last updated