In which context does the "this" keyword not refer to the object that calls the function?
- Global context
- Method context
- Function context
- Constructor context
The "this" keyword in JavaScript does not refer to the object that calls the function in the global context. In the global context, "this" points to the global object, which is usually the "window" object in browsers. This can be a source of confusion, so it's essential to understand the various contexts in which "this" behaves differently.
Loading...
Related Quiz
- An arrow function is defined using the _________ symbol.
- Imagine you're reading a book about the history of web development. The chapter on JavaScript mentions a language that was developed almost simultaneously and competed with JavaScript in the early days. What is the name of this language?
- The block of code inside ______ will be executed if its condition is true and all preceding conditions are false.
- Which of the following scenarios is NOT recommended for using arrow functions?
- The switch statement evaluates expressions based on their _________.