0

How do arrow functions differ from regular functions?

author
subina kallyani
easy
0
344

Answer

Arrow functions are a shorter way to write functions in JavaScript, but they behave differently from regular functions.


Key Differences:

  1. No this binding
    Arrow functions do not have their own this.
    They use the this value from their surrounding scope.
    Regular functions have their own this.
  2. Shorter syntax
    Arrow functions are more concise.
  3. Cannot be used as constructors
    You cannot use new with arrow functions.
  4. No arguments object
    Arrow functions don’t have their own arguments.
    Regular functions do.
  5. No prototype
    Arrow functions do not have a prototype property.

Click to Reveal Answer

Tap anywhere to see the solution

Revealed

Comments0
    How do arrow functions differ from regular functions? - functions | EBAT