1

I am used to the following arrow syntax:

(var1, var2, var3) => {
    statement1;
    statement2;
    ...
}

However, I've also seen it simplified to just:

var1 => something

What are the rules for when the arrow statement can be simplified. Specifically:

  • Not need parens before the =>?
  • Not need { ... } around the function body?
VLAZ
  • 26,331
  • 9
  • 49
  • 67
samuelbrody1249
  • 4,379
  • 1
  • 15
  • 58

0 Answers0