Skip to content

'The "This" keyboard' examples are not working properly. #444

Closed
@Aleix21

Description

@Aleix21

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions