I am new to programming and js and I am trying to learn crux of javascript.
var obj1 = {
name: 'rawn',
fn: function() {
console.log(this);
}
};
console.log(obj1.fn());
When I output this I get the object(as expected) - {name: "rawn", fn: ƒ} and on another line I get - undefined. So my question is why and how do I get undefined?
My understanding is that, we are writing this line - console.log(obj1.fn()); as , console.log(console.log(this)), so how does javascript engine gives the result as undefined (what was put as undefined in the execution context)?