The Next Generation JavaScript.

Amadi Austin Chukwuemeka
Studevs
Published in
4 min readJul 7, 2019

The next generation JavaScript simply means the Es6 JavaScript features. As a JavaScript developer it is important you understand and implement this features in your workflow, because it helps you to write clean and robust JavaScript apps. Without wasting much of our time, lets discuss them.

  1. let and const keyword: This are the two new ways of creating variables in the next generation JavaScript. The let keyword is used in creating variables that are reusable, variables created with the let keyword can only be used in the block scope where the are created( unlike the var keyword )while the const keyword is used in creating variables that will contain or store constant values or functions(values that will not be changed).

2.Arrow functions: This is a special syntax for creating a JavaScript function, a normal JavaScript function is declared with the function keyword but with this new Es6 feature, we can declare our function expression using the equal sign followed by the greater than sign( => ),a parenthesis may be needed if the function will be needing more than one argument . Using the arrow function helps in solving the problem of the “this keyword” by keeping its context without changing it during its run-time. In general,using the arrow function creates a short syntax for writing our function expressions.

3.Exports and Imports: Another feature which next generation JavaScript offers is the support in writing of modular codes. By writing modular codes we mean writing JavaScript files which can be shared or accessed by other JavaScript files and this is made possible with the Exports and Imports keywords. We have two types of Exports the include a. The default Export b.The Target Export.

a.The Default Export: This involves exporting the whole JavaScript file and setting the filename as default.

b.The Targeted Export: This involves exporting specific or targeted function or variable in a JavaScript file.

We also have 2 kinds of imports the include

a.The Default Import: This involves importing the whole JavaScript file from another module.

b. The Targeted Export: This involves importing specific or targeted function or variable in a file by using curly braces to target the particular filename you used during its export.

4.Classes: This is another core feature of next generation JavaScript, if you are coming from another programming language, this feature should be an exciting thing to you, because you can gracefully implement and write your code using classes and object structures .

Note: You can create your class properties without using the constructor function call, and you can as well use the arrow function symbol when creating your methods.

5. The Spread And Rest Operators: This involves the use of a symbol called free dots(…) in our code. Its use will determine when we are to call it a spread or rest operator.

The Spread Operator is used to split up array element or object properties so as to add new elements or properties.

The Rest Operator is used to merge a list of function arguments into an array..

6. Destructuring : This is another new generation JavaScript that is used in extracting array elements or object properties so as to store them in variables.

Note: Not many browsers support this new features yet, but will soon. But not to worry the JavaScript transpiler called babel is ever ready to help solve the problem of browsers cross compatibility.

In Conclusion I strongly recommend the use of these new features because:

1. It is Faster

2. It helps you to write less error prone code.

3. It is easier to read.

4. It is considered the best practice.

--

--

Amadi Austin Chukwuemeka
Studevs
Writer for

I am a Software Engineer who is passionate about solving complex problems by Building technological solutions out of business needs.