Skip to content

Can you change the this with call and apply? #52

Open
@matthewp

Description

@matthewp

I think the answer is that you can, but it was unclear to me from the examples. For example:

const introduceBob = bob.introduce~();
introduceBob();

What if you do:

const introduceBob = bob.introduce~();
introduceBob.call(barbara);

I assume the this in introduce refers to barbara and not bob, correct?

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