Skip to content

2015年3月6日 作用域 #42

@nunnly

Description

@nunnly
function a(x,y){
    y = function(){x=2;};
    return function(){
        var x = 3;
        y();
        console.log(x);
    }.apply(this,arguments);
}
a();
//求最后的输出
//题目来自
//https://gist.github.com/ruanyf/cae49b92b0bd43c4d57d

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions