In JavaScript, the this operator behaves a little differently compared to other languages. The value of the this operator is often determined by the way a function is invoked. Its value cannot be set by assignment during execution, and it may be different each time a function is invoked.
The this operator also has some differences when using strict and non-strict modes. ECMAScript 5's strict mode is a way to opt into a restricted variant of JavaScript. You can learn more about strict mode at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.