趣加(FunPlus)一面面经
1. 自我介绍
2. 说说在项目中遇到的难点
3. 说说vue的生命周期,父子组件的生命周期
4. 说说下面代码的执行结果
async function async1() {
console.log('async1 start');
await async2();
console.log('async1 end');
}
async function async2() {
console.log('async2');
}
console.log('script start');
setTimeout(function() {
console.log('setTimeout');
}, 0)
async1();
new Promise(function(resolve) {
console.log('promise1');
resolve();
}).then(function() {
console.log('promise2');
});
console.log('script end'); 5. DOM事件中target和currentTarget的区别 -
target是事件触发的真实元素
-
currentTarget是事件绑定的元素
-
事件处理函数中的this指向是中为currentTarget
-
currentTarget和target,有时候是同一个元素,有时候不是同一个元素 (因为事件冒泡)
- 当事件是子元素触发时,currentTarget为绑定事件的元素,target为子元素
- 当事件是元素自身触发时,currentTarget和target为同一个元素
7. apply和call的区别
8. flex的属性
9. 箭头函数和普通函数的区别,箭头函数可以实例化对象吗
10. map和filter的区别
查看22道真题和解析
