搜索整理的面试题

1、js中使用replace正则匹配的方法去除字符串左空格
2、写出5个js字符串操作函数并注明功能
3、如何新建一个obj对象,可执行obj.a().b().a()
4、数组方法slice()和splice()的区别
5、 typeof null
typeof Symbol()
typeof undefined
6、 let a = 0;
if([]){
  a = a+1;
}
if([] == true){
  a = a+2;
}
if(![] === false){
  a = a+3;
}
console.log(a++ +' : '+ ++a)
7、如何解决vue首屏加载慢的问题
8、简述Vue中is、ref、key的特性
9、vue-cli如何创建自定义指令
10、如何解决不同浏览器的样式兼容性问题
11、简述如何防御CSFR
12、对于生命周期的理解
13、var arr = ['1', '2', '3'];
var r = arr.map(parseInt);
console.log(r);                   _________
var m = arr.map(x=>parseInt(x));
console.log(m);                  _________
14、填写该行输出内容
function Parent() {
    this.name = 'parent';
}
Parent.prototype.say = function () {
    console.log('say');
};
function Child(age) {
    Parent.call(this);
    this.age = age;
}
var p = new Parent();
p.say();                        _______
var c = new Child(12);
c.say();                        _______
15、function A() {
   this.name = 'a'
   this.color = ['green', 'yellow']
}
function B() {
  
}
B.prototype = new A()
var b1 = new B()
var b2 = new B()
b1.name = 'change'
b1.color.push('black')
console.log(b1.name)
console.log(b2.name)
console.log(b1.color)
console.log(b2.color)

猜你喜欢

转载自www.cnblogs.com/yl179578605/p/10619217.html