美文网首页
2020前端面试题记录。

2020前端面试题记录。

作者: __小白___ | 来源:发表于2020-06-13 13:49 被阅读0次

1.实现一个函数 a(x)(y)与a(x,y)输出一样的值。

function output(a){
     if(arguments.length==2){
        return parseInt(arguments[0])+parseInt(arguments[1]);
     }
     else{
        return function(b){
            return a+b;
        }
     }
}

2.css显示垂直居中的几种方式。
3.v-model的语法糖。
4.事件委托的原理。
5.强缓存以及协商缓存。
6.深浅拷贝区别。
7.js实现继承的几种方式(原型链继承、对象冒充、组合继承)

function  test(age,name){
 this.age=1;
this.name="test"
}
function test_child(){
test.call(this); //对象冒充  无法继承原型链上的属性
}
function test_propoty(){
}
 test_propoty.prototype=new test(); //原型链继承。 无法给父类传参

//组合继承
function test_group(name,age){
  test.call(this,age,name)
}
test_group.prototype=new test();

持续更新中.。。。。(2020-6-14)

相关文章

网友评论

      本文标题:2020前端面试题记录。

      本文链接:https://www.haomeiwen.com/subject/kmiatktx.html