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»

The OUTPUT LOGGED will be:

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.
Now, when arguments[0]() is called, then ARGUMENT[0] is equivalent to “fn” and function fn is called. But “this” now is the arguments ARRAY, which is of length 2 because it contains two arguments (fn, 1). So, “this.length” will produce 2.



Discussion

No Comment Found