Arrow function Flashcards
1
Q
What is the syntax for defining an arrow function?
A
const variable = () => {} (parameter) => expression parameter => {statements}
2
Q
When an arrow function’s body is left without curly braces, what changes in its functionality?
A
the arrow function has an implicit return.
curly braces, implicit return, have to include return statement
3
Q
How is the value of this determined within an arrow function?
A
lexical scope, takes the this from the scope it was defined in