es6 - arrow - functions Flashcards
1
Q
What is the syntax for defining an arrow function?
A
const name = (p1) => code; or {code with return};
2
Q
When an arrow function’s body is left without curly braces, what changes in its functionality?
A
you do not need a return statement
3
Q
How is the value of this determined within an arrow function?
A
it is the value of the enclosing context- instead of creating its own - gets value of where it was defined - not who calls it