Skip to content

this那篇习题答案有误 #1061

Description

@xiaowangge666
   在this那篇教程上说下方代码是会报错 因为this是undefined 但是实际不会

function makeUser() {
return {
name: "John",
ref: this
};
}

    let user = makeUser();

    alert(user.ref.age);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SolvedProblem solved

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions