The Magic of this, call(), apply(), and bind() in JavaScript
What is this?
this = "Who called this function?"
Simple as that.
const person = {
name: "Alice",
greet: function() {
console.log("Hello, I'm " + this.name);
}
};
person.greet(); // "Hello,
techsorcerer.hashnode.dev8 min read