I was learning this in JavaScript and according to my understanding inside strict mode this should be undefined but when I try this
"use strict";
function demo () {
// Here this is Undefined in strict mode
console.log(this);
}
//Here this refers to the Global Object
console.log(this);
demo();
As mentioned in the comment, console still prints the Window Object except when I call the demo() object. Why is that so?