Anonymous vs. Arrow Functions

Choosing between arrow and anonymous functions

At first sight, it may appear that arrow functions are direct replacements for anonymous functions. You may be tempted to hastily replace anonymous functions with arrow functions. However, this could result in code that behaves differently than you intend. There are many semantic differences between anonymous functions and arrow functions, and we have to carefully choose between them based on the context.

Learning about the key differences between the two types of functions will help you pick the right one.

In this lesson, we will cover the two main points

  1. Lexical vs dynamic scoping
  2. Differences in bind, call and apply

Get hands-on with 1400+ tech skills courses.