Front-end comprehensive interview questions (9 questions)

  From html to the basic principles of Vue, it is common sense, just memorize it.
  Briefly describe the background story. Today, a young man came to our company for an interview. The supervisor temporarily asked me to act as an interviewer. The personal work experience is good and the interview experience is average. He casually asked him 8 questions, and the young man answered well. I asked him to discuss salary with personnel tomorrow. In our interview session, the interviewer is not necessarily the front-end staff, or the work experience is not as rich as you and me. I will not say that our company only uses Vue to develop projects and only asks you Vue to pass parameters and package, covering all front-end knowledge points In order to see whether a person's basic skills are solid. The interview questions are as follows:

1. There is a double mark tag in
html that allows the text to slide arbitrarily 2. How to indent the first line in
CSS 3. Adjust text spacing in CSS
4. Have you ever used a flexible box? How to allow line
breaks 5. What is a closure, and what are the advantages and disadvantages?
6. Will closures cause memory leaks, and how many megabytes?
7. What are prototypes and prototype chains?
8. What is the difference between computed and watch?
9. What is anti-shake and throttling?

Answer reference:
1,marquee

<marquee direction=left>组图:盘点2020年十大自然景观</marquee>

The text slides slowly to the left.

2,text-indent

text-indent:2em;

3,letter-spacing

letter-spacing:12px

4,flex-wrap:wrap;

5. Briefly: A function to access variables in a function scope.
Advantages: Avoid the pollution of global variables and the existence of private members.
If you want a variable to stay in memory for a long time, then you can use a closure function. This is both the advantage of the closure function and the disadvantage of the closure function (normal function variables are destroyed after execution, but closure function variables will not be destroyed ).

6. When the memory usage reaches 16M, the closure function will leak memory.

7, each class has a prototype prototype display
   each instance has an implicit prototype of __proto__
   every instance of the __proto__prototype implementation of the corresponding class of
   when to find a property or method of the object, first look at itself and if it can not find, will be along the __proto__look up a chain of relationships formed in this way is called the prototype chain.

8, watch is used to monitor events, execute a function when data changes;
computed calculates new values ​​based on existing data.

9, Anti-shake: after multiple trigger events, the function can only be executed once in n seconds;
  throttling: after multiple trigger events, the function is executed once every n seconds;

(End of this chapter)

  The front-end learning is not done overnight. Without stepping, there is no way to reach thousands of miles. Only by continuous hard work can you and me gain something. Professional knowledge can be learned by institutions. The establishment of training institutions has its inevitability. Are you spending the money right?

Guess you like

Origin blog.csdn.net/weixin_45820444/article/details/108717091