Programming · Flashcard

What is the main syntactic feature of an arrow function?

  • AIt uses the => syntax and omits the function keyword for a shorter form
  • BIt uses the -> syntax and omits the function keyword for a shorter form
  • CIt requires the function keyword followed by a => before the body
  • DIt must be declared with the arrow keyword before the parameter list

Why this is the answer

Arrow functions use => and drop the function keyword for a shorter form. JavaScript uses => not ->, arrows don't keep the function keyword, and there's no arrow keyword.

Official docs
Study in Gnoseed →