let counter = 0;
console.log(++counter, "[solto] this", this);
function MyFunction() {
console.log(++counter, "[function] this", this);
}
MyFunction();
new MyFunction();
const MyArrowFunction = () => {
console.log(++counter, "[arrow_function] this", this);
}
MyArrowFunction();
const myCustomObject = {
MyFunction,
MyArrowFunction,
};
myCustomObject.MyFunction();
myCustomObject.MyArrowFunction();
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.