From the course: Learning Functional Programming with JavaScript ES6+

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Arrow functions in ES6

Arrow functions in ES6 - JavaScript Tutorial

From the course: Learning Functional Programming with JavaScript ES6+

Start my 1-month free trial

Arrow functions in ES6

- [Instructor] Since throughout the rest of the course we want to take full advantage of many of ES6's features, the first thing we're going to do is really solidify our experience with the alternative syntax that ES6 provides for defining functions. In JavaScript prior to ES6 the most common way of defining functions was to use the function keyword. And there were two ways of doing this, either by writing function, the function's name, and then the arguments like this. Function myFunction and the arguments, arg1, arg2, et cetera, and then brackets followed by the function body. Or by using var, let, or const to define our function like this. Const my0therFunction = function, and then the arguments, arg1, arg2, and then brackets followed by the function body. Now ES6 allows us to get rid of the function keyword completely by providing us with a new syntax called arrow functions. Many of you may already be familiar with arrow functions or you may not. But either way, since I'll be…

Contents