Let and Const
ES6 Arrow functions
Arrow function is a way to create functions using shorter syntax and has more advantages when it comes to managing the scope of this keyword.
Exports and Imports
For the ease of maintainability and manageability, people love to write modular codes. Basically split the code into a more focused set of files. In such scenarios, to access some functionalities in one file from another file, you need export (to make it available) and import (to get access) them in required places.
A file can contain one default and an unlimited number of named exports.
A class is a blueprint for a JS object. Classes can replace the constructor functions and prototypes.
Spread and Rest Operator
The syntax for Spread and Rest operator is the same and it is … (three dots). The usage will determine whether you use it as a Spread or Rest.
Spread operator allows you to pull out all the elements from an array or pull out all the properties of an object. Check below examples
The … operator is really helpful for cloning arrays and objects(since both are reference type copying them safely can be tricky). Spread operator helps to create a clone of an object or an array very easily.
Accessing values of arrays (or objects) and assigning them to variables.
Destructuring is a really helpful feature with function arguments. check the example below. In that example, we only use the value of “name” property inside the printName function.
We can use all the above cool features to save our time and code :)