I was reading a Execution Context in JavaScript
article, and I undoubtedly understand what is execution context in JavaScript
.
function Foo() {
// Execution context of Foo function is here, between curly braces
}
Also I read about Arrow Functions
and its properties, But a question arose for me:
Where is an Arrow function execution context?
const ArrowFoo = () => {
// Where is ArrowFoo function execution context?
// Is here? or the upper block scope?
// Or global scope?
}
The execution context of an arrow function is a function execution context like for all other functions.
Similar too foo
, the body of the arrow function (between the curly braces) contains the code that executes in this execution context.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.