Menu Links

Wednesday, May 18, 2016

JavaScript - this

this Object

"this" object mean in object oriented language - refer to the current object.

But when we think in JavaScript language it's bit different as JavaScript is a functional oriented language not object oriented.

When ever we create a function in JavaScript, it mapped your all variables and inner function objects either in local or global memory area based on the scope of variables and inner functions. 

Every function Inside local memory heap create one more additional object called "this". it refer to window  object.

e.g.      function blogs()
            {

                 var x = 10;    // local variable
                 y = 20;     //global variable

                  var obj = function(){}// inner anonymous function

             } 

What is the understanding of above example.. ? How this function variable and functions are mapped to browser memory? What are the wrong statement written for the performance prospect? Where is my "this" object?

No comments:

Post a Comment