day10

1-下面代码执行的结果是什么?    var length=10             function fn(){                 console.log(this.length)             }             var obj={                 length:5,                 method: function(fn){                     fn()                     arguments[0]()                 },             }             obj.method(fn,1)   0 2 2-下面代码执行的弹出结果是什么?   (function test(){                    var a=b=5                     alert(typeof a)                     alert(typeof b)                })()                alert(typeof a)                     alert(typeof b)   number number  undefined   number 3-下面代码执行的结果是什么?   console.log(square(5))           var square=function(n){             return n*n;           }   square is not a function 4-下面代码执行的结果是什么?   for(var i=1;i<=5;i++){                 setTimeout(function(){                     console.log(i)                 },1000)           }   666666 5-下面代码执行的结果是什么?   for(var i=1;i<=5;i++){                 (function(i){                     setTimeout(function(){                     console.log(i)                 },1000*i)                 })(i)           }   12345
上一篇:day10作业


下一篇:RabbitMq指南:彻底解决消息可靠性问题以及实现延迟队列