Front-end written test questions

Front-end written test questions

Netease 2020 school recruitment interview questions analysis in advance

Js apply method detailed

Netease front-end written test questions

Array de-duplication & object array de-duplication according to a certain attribute

1.The difference between null, undefined, undeclared

1. Null means "no object", that is, there should be no value there, and it is 0 when it is converted to a value. Typical usage is:

(1) As a function parameter, it means that the function parameter is not an object.

(2) As the end of the object prototype chain.

2. Undefined means "missing value", that is, there should be a value here, but it has not been defined yet. When converted to a value, it is NaN. Typical usage is:

(1) When the variable is declared, but is not assigned, it is equal to undefined.

(2) When calling the function, the parameter that should be provided is not provided, and the parameter is equal to undefined.

(3) The object has no attribute assigned, and the value of the attribute is undefined.

(4) When the function does not return a value, it returns undefined by default.

3.undeclared: js syntax error, use directly without affirmation, js cannot find the corresponding context.

2.visibility: the difference between hidden and display: none

1. Display: none hidden elements do not occupy any space, and visibility: hidden hidden element space is still reserved;

2. Visibility has inheritance, set visibility: hidden to the parent element; child elements will also inherit this attribute. But if you set visibility: visible to the child element again, the child element will be displayed again. This is qualitatively different from display: none

3. Visibility: hidden does not affect the counting of the counter. As shown in the figure, although visibility: hidden makes an element disappear, its counter is still running. This is completely different from display: none

4. The transition of CSS3 supports the visibility property, but it does not support the display. Because the transition can be delayed, it can be used with the visibility to use pure CSS to achieve the hover delay display effect. Improve user experience.

3. What are the common HTTP status codes

1: Status code at the beginning of 2

2xx (success) status code indicating that the request was successfully processed

200 (Success) The server has successfully processed the request. usually.

Two: status code at the beginning of 3

3xx (redirect) indicates that further action is required to complete the request. Usually, these status codes are used for redirection.

304 (Unmodified) The requested page has not been modified since the last request. When the server returns this response, the content of the web page will not be returned.

Three: status code starting with 4

4xx (request error) These status codes indicate that the request may have gone wrong, preventing the server from processing

1:400 (Bad request) The server does not understand the syntax of the request.

2:403 (Forbidden) The server rejected the request.

3:404 (Not found) The server could not find the requested page.

4: Status code at the beginning of 5

5xx (Server Error) These status codes indicate that an internal error occurred when the server was trying to process the request. These errors may be errors of the server itself, rather than request errors

500 (Internal Server Error) The server encountered an error and could not complete the request.

501 (Not yet implemented) The server does not have the function to complete the request. For example, the server may return this code when the request method is not recognized.

502 (Bad Gateway) The server was acting as a gateway or proxy and received an invalid response from the upstream server.

503 (Service unavailable) The server is currently unavailable (due to overload or maintenance shutdown). Usually, this is only a temporary state.

504 (Gateway timeout) The server is acting as a gateway or proxy, but it did not receive a request from the upstream server in time.

505 (HTTP version is not supported) The server does not support the HTTP protocol version used in the request.