In the global context, the this operator will always point to the global object. In a web browser, the window object is the global object:
console.log(this === window); // true this.a = 37; console.log(window.a); // 37 console.log(window.document === this.document); // true console.log(this.document === document); // true console.log(window.document === document); // true