ECMAScript 6

What is ECMAScript 6 (ES6)?

Generally, ES6 is a modern update of javascript. It’s also called JS6 or ECMAscript2015.

Why should we learn ES6?

We should learn ES6 for
React JS,
React Native,
Vue JS,
Electron JS
and Node JS.

Let’s talk about some ES6 methods:

Variable Hoisting:

Generally, we declare a variable first and then set his value. Like:

var name= “Touhid”;
console.log(name);

But if we need to assign a value first and then declare a variable, it is called Variable Hoisting. Like:

name= “Touhid”;
console.log(name);
var name;

Arrow Functions:

Usually, we declare a function in two ways. I show you these systems example.

Example 1:
function sum () {
}

Example 2:
var sum = function(){
}

Now we will see the shortcut way to declare a function, that is arrow function.

const sum = () => {
}

In this declaration system, there is an arrow sign. For this reason, it’s called Arrow Function.

That’s all for today. Will see you on the next blog.

--

--