Skip to content

this那篇习题答案有误 #1061

@xiaowangge666

Description

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

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

    let user = makeUser();

    alert(user.ref.age);

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