Difference between ES6 Arrow functions and Regular functions in JavaScript

Arrow functions vs Regular functions

Balaji Dharma
4 min readJul 1, 2020
Photo by Nwar Igbariah on Unsplash

ES6 introduced a new way of writing simple and concise functions. The arrow functions expression is explained in the ES6 Arrow Functions in the JavaScript blog.

Arrow function very useful for developers, yes it helps to make the coding is faster. Arrow functions are commonly used wherever an anonymous function expression is required like callback functions.

According to MDN, the arrow function is described as below

An arrow functions expression is a syntactically compact alternative to a regular expression, although without its own bindings to the this, arguments, super, or new.target keywords. Arrow function expressions are ill suited as methods, and they cannot be used as constructors.

If you confessed to the above MDN statement, don’t worry the arrow function differences are listed below and explained with simple examples.

  • Shorter function expression
  • No ownthisKeyword bindings
  • No argumentsbindings
  • No duplicate named parameters
  • Using constructor & new keyword

Shorter function expression

--

--

No responses yet