Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小目标 #2

Open
coderunner-xinxin opened this issue Aug 8, 2019 · 0 comments

Comments

@coderunner-xinxin
Copy link
Owner

commented Aug 8, 2019

前端面试题及答案汇总

  • 第 1 题:写 React / Vue 项目时为什么要在列表组件中写 key,其作用是什么?

公司:滴滴、饿了么

解析:第 1 题


  • 第 2 题:['1', '2', '3'].map(parseInt) what & why ?

解析:第 2 题


  • 第 3 题:什么是防抖和节流?有什么区别?如何实现?

公司:挖财

解析:第 3 题


  • 第 4 题:介绍下 Set、Map、WeakSet 和 WeakMap 的区别?

解析:第 4 题


  • 第 5 题:介绍下深度优先遍历和广度优先遍历,如何实现?

解析:第 5 题


  • 第 6 题:请分别用深度优先思想和广度优先思想实现一个拷贝函数?

解析:第 6 题


  • 第 7 题:ES5/ES6 的继承除了写法以外还有什么区别?

解析:第 7 题


  • 第 8 题:setTimeout、Promise、Async/Await 的区别

解析:第 8 题


  • 第 9 题:Async/Await 如何通过同步的方式实现异步

公司:头条、微医

解析:第 9 题


  • 第 10 题:异步笔试题

请写出下面代码的运行结果

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');

公司:头条

解析:第 10 题


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.