Update: Thank you for your support, recently toss a summary of information, convenient for you to read the system, there will be more content and more optimization, click here to view
—— The following is the text ——
The introduction
Some time ago, I set up a daily-interview-Question project on GitHub to provide one frequently used Interview Question every day to help you find and fill in the gaps. Today, I will send you the Interview questions and some answers collected in the last half month, hoping to be helpful to you.
Welcome the interview questions you think are good. Please leave your answers in the project Issue area to participate in this project. Due to the time problem, I only provide the questions, and the answers will be provided by your friends temporarily.
The project address is: github.com/Advanced-Fr…
Daily Interview questions
React/Vue: Why do you write a key in your React/Vue project
1. The function of key is to find the corresponding node faster during the execution of diFF algorithm and improve the speed of DIFF.
Stage 2:['1', '2', '3'].map(parseInt)
what & why ?
[‘1’, ‘2’, ‘3’]. Map (parseInt
Phase 3: What is anti-shake and throttling? What’s the difference? How to do that?
The third question is my personal opinion on throttling and shaking prevention
Phase 4: Introduce the difference between Set, Map, WeakSet and WeakMap?
WeakSet, Map, WeakSet and WeakMap
Depth-first traversal and breadth-first traversal. How to implement them?
I have some opinions about the fifth question
Please implement a copy function using depth-first and breadth-first ideas respectively.
6. Implement deep copy
What is the difference between ES5/ES6 succession other than the way it is written?
Feel free to leave your answers in the Issue section.
Issue 8: Differences between setTimeout, Promise, Async/Await
Feel free to leave your answers in the Issue section.
How to Async/Await Async
Feel free to leave your answers in the Issue section.
Unit 10: Asynchronous pen questions
Write the result of the following code
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');
Copy the code
10. What do you think of the passage
Problem 11: Algorithmic handwriting
Given the following array:
var arr = [ [1, 2, 2], [3, 4, 5, 5], [6, 7, 8, 9, [11, 12, [12, 13, [14] ] ] ], 10];
Write a program to flatten and divide an array of duplicate data, resulting in an ascending and non-repeating array
11. Flatten the array and remove duplicates, resulting in an ascending and non-repeating array
The development history of JS asynchronous solution and its advantages and disadvantages.
12
Question 13: Is the Promise constructor executed synchronously or asynchronously, but what about the then method?
14. How to make a new valentine’s Day
14. Happy Valentine’s Day!