Next Generation JavaScript — Cool Features

Source: here

JavaScript is an interpreted programming language which plays its role along with the HTML and CSS in the World Wide Web. This article will discuss a set of cool and rich features of next-generation JavaScript throughout this Article.

Let and Const

In modern JavaScript, Let and Const are used as replacements for var. Var is the keyword which is used to declare variables. Const should use to declare variables with constant values (you cannot reassign values to a variable which is declared as 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 :)