JavaScript: Arrow Functions vs Regular Functions

Mariola P
1 min readSep 6, 2020

Arrow functions were introduced in ES6 and they allow us to write a more concise code. While both regular and arrow functions work in a very similar way, there are a few differences between the two.

There are 3 main differences between regular functions and arrow functions in JavaScript.

  1. ‘This’ keyword

It is impossible to use “this” keyword in arrow functions while in regular functions ‘this’ keyword can be used without any problems.

2. ‘New’ keyword

A constructable function, can be called with ‘new’, i.e. new User(). A collable function can be called without new.

Unlike the regular functions, the arrow functions are not “constructible” but “callable” so the keyword “new” won’t work. Regular functions are both “callable” and “constructible” therefore we can use the “new” keyword with regular functions.

If you are trying to call a non-callable function or to construct a non-constructable function, you will get a runtime error.

3. Arguments Array

In JavaSript arguments array in functions is a special object that can be used to get all the arguments passed to the function. Similar to this, arrow functions do not have their own binding to a arguments object, they are bound to arguments of enclosing scope.

--

--