Posts List

What is the Meaning of `this` — Javascript Function Invocation and `this`

Anyone who has worked extensively with a strong OO language before writing their first line of Javascript is going to find out very quickly that they are not in Kansas anymore. For starters, without using some of ES2015’s goodness (ES6 previously) Javascript does not have block scope—it has function scope. Before the days of let, this means that variables cascade down the function chain. For instance, if we declare a variable outside of any function or without specifying var before instantiating a variable (aka implicit declaration) for the first time, that variable is global.