this in a function

The keyword this when used in a function refers to the global object.

Note: in a browser window the global object is the window object.

Visit the following resources to learn more: