This keyword in method

What does it mean when it says that this’s value is the global object? What is the global object in this case?

https://www.codecademy.com/courses/introduction-to-javascript/lessons/advanced-objects/exercises/arrow-and-this?action=resume_content_item

The global object is the entire context all JavaScript operations are conducted in. In the web browser, the global object would be window. Note that window also contains document as window.document. And a function defined as function a(){} is added to this context as window.a().

Pragmatically, the global object in web browsers is the window object. function a(){ console.log(this); } logs the window object.

2 Likes