Getting Started with Modern JavaScript — Arrow Functions

Syntax

var sum = function(a, b) {
return a + b;
}
sum(1, 2) // -> 3
const sum = (a, b) => a + b;sum(1, 2) // -> 3
const square = n => n * n;square(3); // -> 9

This

Regular Functions

Arrow Functions

Should we always use Arrow Functions?

Methods

Constructor

Conclusion

Getting Started Series

Frontend Architect • JavaScript Enthusiast • Educative.io Author • ngVikings organizer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store