Refrence to windows object/global scope inside variable can be like this. Here i assume you are in global scope
var reftowindows = this;
I am referring to dynamically creates scopes of functions and so
fourth.
Function defined at global scope
function returnRefrence(){
var refvar = this;
return this;
}
Calling function return variable holding refrence to window
as scope
console.log(returnRefrence()); // console logs "window" object
Calling function with call() and binding it to object changes the scope and returns variable holding refrence to obj
as scope
obj = {};
console.log(returnRefrence.call(obj)); // console logs "obj" object