this is my code
let status = "๐Ÿ˜Ž";
setTimeout(() => {
const status = "๐Ÿ˜";
const data = {
status: "๐ŸŠ",
getStatus() {
return this.status;
},
};
console.log(data.getStatus());
console.log(data.getStatus.call(this));
}, 0);
expected output
๐ŸŠ
๐Ÿ˜Ž
But getting
๐ŸŠ
undefined