es6-arrow-functions Flashcards
What is the syntax for defining an arrow function?
(parameters) => { statements }
When an arrow function’s body is left without curly braces, what changes in its functionality?
When an arrow function’s body is left without curly braces, the function will automatically return the value of the expression that follows the arrow.
How is the value of this determined within an arrow function?
the value of this is determined by the context in which the function is defined. It is determined by the value of this in the scope that the arrow function is defined in. If the arrow function is defined inside of another function, this will refer to the same value as the outer function’s this. If the arrow function is defined in the global scope, this will refer to the global object.