From the course: JavaScript Essential Training

Unlock the full course today

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

The arrow function

The arrow function - JavaScript Tutorial

From the course: JavaScript Essential Training

Start my 1-month free trial

The arrow function

- [Instructor] In modern JavaScript, it's more and more common to use arrow functions in place of regular function expressions. Arrow functions are a shorter way of writing function expressions, and they also have some special properties, we can take advantage of. The MDN web docs, have a good breakdown of a prototypical arrow function, you can see it down here. So here we have a traditional function. We declare the function and then we have some properties and then we have the curly brackets and the function body. Looking at the arrow function below you can immediately see it is different. Instead of declaring function, we just use the parenthesis and then we use this arrow, it's an equal symbol and then larger than symbol that literally looks like a big fat arrow, and it points at the curly bracket. Everything else inside the functions of the function body is exactly the same. So the arrow function refers to…

Contents