0

I've tried searching the web for an answer, or I may just be thinking about it too much. While watching some React videos I see devs using arrow functions two ways:

  1. const name = () => {} -- here ending with curly braces and
  2. const name = () => () -- here ending with parentheses

Is there a difference between the 2?

1 Answers1

-3

The second will return the value of the expression inside the brackets after evaluation.

The first will require a return statement to return a value.

Spectric
  • 30,714
  • 6
  • 20
  • 43