![]() |
VOOZH | about |
ES6, or ECMAScript 2015, is the 6th version of the ECMAScript programming language. ECMAScript is the standardization of JavaScript, which was released in 2015 and subsequently renamed as ECMAScript 2015.
The let variables are mutable, i.e., their values can be changed. It works similarly to the var keyword with some key differences, like scoping, which makes it a better option when compared to var.
It prevents variable leakage outside of the intended scope.
const is used to declare variables with a constant value, ensuring the value cannot be reassigned.
Ideal for declaring configuration constants or fixed values.
Arrow functions provide a concise syntax for writing function expressions and automatically bind this to the surrounding context.
Destructing in JavaScript basically means the breaking down of a complex structure(Objects or arrays) into simpler parts
Object Destructuring
Array Destructuring
The spread operator expands an array or object into individual elements or properties.
The for/of loop allows you to iterate over iterable objects like arrays, strings, Maps, and Sets but in a short syntax as compared to other loops.
Iterating Over an Array
Iterating Over a String
Map:Maps store key-value pairs where keys can be any data type.
Set: Sets store unique values of any type.
Set(3) { 1, 2, 3 }
ES6 introduced classes in JavaScript. Classes in javascript can be used to create new Objects with the help of a constructor, each class can only have one constructor inside it.
Promises simplify handling asynchronous operations by providing .then and .catch methods.
Allows functions to have default values for parameters.