Introduction to JavaScript Arrow Functions

A lot of new features came out with ES6. in this video, you will learn how to use the JavaScript Arrow function to write more concise code for function expressions.

ES6 arrow functions provide you with an alternative way to write a shorter syntax compared to the function expression.

Arrow function vs. regular function:

There are two main differences between an arrow function and a regular function.

– First, in the arrow function, the this, arguments, super, new.target are lexical. It means that the arrow function uses these variables (or constructs) from the enclosing lexical scope.

– Second, an arrow function cannot be used as a function constructor. If you use the new keyword to create a new object from an arrow function, you will get an error.

I like to hear from you about this !!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.