Video – Arrow Function in JavaScript

Arrow function was introduced in ECMA 6.  It is different than function statement or expression , as it does not have its own ‘this’ , and can also not be used as constructor.  Some important points about Arrow function are:

  • It does not have prototype property
  • It does not have arguments parameter
  • It does not have its own ‘this’
  • It can not be used with new operator

I have written a detailed article on Arrow function here :

https://www.infragistics.com/community/blogs/b/infragistics/posts/easy-javascript-part-6-arrow-functions-in-javascript

Watch this video to learn more about Arrow function

 

Please do  not forget to subscribe  geek97 YouTube channel geek97 YouTube channel for update about future videos.

 

Arrow functions in JavaScript

The JavaScript arrow function is a shorter way of writing a function expression that was introduced in ECMAScript 6. Usually in JavaScript, you can create a function in two ways:

  1. Function as statement
  2. Function as expression

A function statement can be created as shown below:

image

The same function can be created as a function expression as shown below:

image

ECMA 2015 (or ECMA Script 6) introduced shorter syntax to write a function expression called the arrow function. Using the arrow function, you can write the function expression above as seen here:

image

As you see, writing a function expression using the arrow function is shorter.

Basic syntax rules for arrow functions

First, parameters should be passed in the small parentheses. You can create an arrow function with two parameters as shown below:

Read full article on the Infragistics blog