MY #100 DAYS OF CODE CHALLENGE JOURNEY-DAY 13

in #coding6 years ago

IMG_20190215_173911.jpg

Welcome to my daily 100days of code challenge once again and today, I am going to discuss about arrow functions.

Arrow function as a new feature in ES6 was introduced as a way of making the syntax of functions easier. It simplifies and compacts function syntax.

Functions are written in the earlier versions of JavaScript as below:

let doWork = function (x,y) {
return x+y;

}

The above function doWork() takes two parameters and return their sum. From the above function declaration, the keyword is involved.

To write doWork() function using the arrow function, we simply eliminate the function keyword and replace it with the symbols =>

let doWork = (x+y) => x+y;

This is just a simple use of arrow function above.

Coin Marketplace

STEEM 0.26
TRX 0.24
JST 0.038
BTC 95392.30
ETH 3285.89
USDT 1.00
SBD 3.39