首页 > 其他 > 详细

面试题

时间:2019-04-11 15:25:15      阅读:106      评论:0      收藏:0      [点我收藏+]
var v = 123;
function foo(){
    var v = 456;
    function inner(){
        console.log(v)
    }
    return inner
}

result = foo()
console.log(result()) 

# 问输出结果://456

Name=root;
Age = 18;
function Foo(name,age){
    this.Name = name;
    this.Age = age;
    this.Func = function(){
        console.log(this.Name,this.Age);
        (function(){
             console.log(this.Name,this.Age);
        })();
    }
}
obj = new Foo(alex,666);
obj.Func()

# 问输出结果:
// alex 666
// root 18

 

面试题

原文:https://www.cnblogs.com/xiangtingshen/p/10689744.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!