小菜

The best or nothing.

  • 主页
  • 所有文章
  • 友链
  • 关于我
github weibo
html5javascriptnodejs面试题

小菜

The best or nothing.

  • 主页
  • 所有文章
  • 友链
  • 关于我
github weibo
11月 13 2014
javascript
  • javascript

关于call 的面试题两则之我的分析

第一题:

function f1(){
        console.log('this is function f1!');
}

function f2(){
         console.log('this is function f2!');
}

var f3 = f1.call;
f1.call(f2);
f3.call(f2);

第二题:

function fn(a,b){
     console.log(this);
     this.a=a;
     this.b=b;
     console.log(this.a+":"+this.b);
}
fn.call.call(fn,8,7);

more >>

© 2015 小菜
Hexo Theme Yilia by Litten