In the following example, the value of this is set as window.
function multiply(n1, n2) {
return n1 * n2;
}
multiply.apply(window, [3, 4]);
but in the following example, we didn't mention window
const mockingbird = {
title: 'To Kill a Mockingbird',
describe: function () {
console.log(`${this.title} is a classic novel`);
}
};
const pride = {
title: 'Pride and Prejudice'
};
mockingbird.describe.call(pride);
I can't understand the meaning of window and when to use it