Brief about "this" keyword

This refers to an object on which we call out function

Here we are calling a function displayName on object obj1 therefore the value of this inside displayName should be obj1. Note:Always look at what is before '.' operator

No as in the code we are not using "." operator to call the function the value of this will be the window operator. Internally the call actually happens with
"window.displayAge"

Here the value of this will be inside of displayAge is obj1. Therefore we can conclude that when it comes to regular functions the value of this keyword is basically what is before the "."

So it is basically following some sort of dynamic scope ,It depends on how we call the function and not where the function is defined and that is why this is the most confusing topic in JavaScript. When scope is working lexically scope i.e where we define the function why is this keyword working dynamically i.e how we are calling the function and that is where arrow function comes into picture .