InterviewSolution
Saved Bookmarks
| 1. |
const innerFunc = function(_soap) { console.log(`Cleaning ${this. room} with ${_soap}`) } innerFunc(soap); } let harrysRoom = { room: "Harry's room" } cleanRoom.call(harrysRoom, "Harpic"); //Output - Cleaning undefined with Harpic |
|
Answer» 10
2 When INSIDE the method, fn() is called the “this” of the function fn is at window level. So, “this.length” will produce 10. |
|