Closed
Description
Hi!
I was reading the "The "this" Keyboard" and trying the examples there.
In the examples "A function created using Function.bind()" and "A function being attached to an object at runtime." when calling sayHello() the "this" object takes an unexpected value and therefore the value of this.myName is undefined (as opposed of the expected response)
In this first usage of the function the "this" object should be the window object and the function sayHello() should not be attached to any object. Why doesn't the function sayHello() recognize the myName variable, which has the value "the global object" in these examples?
Thank you!!
Metadata
Metadata
Assignees
Labels
No labels