
//The following example will show the different ways of executing functions in javascript
// The this keyword points to different objects depending on the context. it can refer to a window(browser), global object(node js), current object(object.foo()), empty object(new function())


//Method #1 : in this method of calling function this refers to the global object.
function foo() {
    console.log("Hello, this inside foo function");
    console.log(this);
}
foo();    


//Method#2 : in this method of calling function this refer to the current object
var object = {};
object.foo = function(){
    console.log("Hello, this is foo function inside object");
    console.log(this);
}
object.foo();   

 //Method#3 : in this method of calling function this refers to an empty object
new foo(); 

//Method#4 : in this method the this reference is bind to the object passed as and argument 
foo.call({});



@@ -276,16 +276,108 @@
 tion())%0A
+// Reference Link : https://www.youtube.com/playlist?list=PLqq-6Pq4lTTaflXUL0v3TSm86nodn0c_u
 %0A%0A//Meth

Update 3-function_execution_types.js