JS: bind, call, apply
by matox
JavaScript
function hello() {
console.log(this, this.face);
}
const clown = {face: 'clown'};
const lpm = {face: 'lollipop man'};
hello();
hello.call(clown)
by matox
function hello() {
console.log(this, this.face);
}
const clown = {face: 'clown'};
const lpm = {face: 'lollipop man'};
hello();
hello.call(clown)