1, what are the methods of page optimization
-
- Reducing HTTP requests
-
- Reduce the DOM element count
-
- Strip JavaScript and CSS from your pages
-
- Remove duplicate scripts
-
- Use appropriate image formats
2. Semantic understanding
-
Semantic HTML is to make the content of the page structured, easy to browser, search engine parsing;
-
It is displayed in a document format without CSS styles and is easy to read.
-
Make it easier for people reading source code to divide the site into chunks for easy reading, maintenance and understanding.
3. What is the difference between return, break, and continue
A return must be written inside the function. If a return is encountered, the rest of the code inside the function is not executed. You can also use return to return a value for external use
Break breaks the loop and the rest of the loop is not executed
Continue Jumps out of the loop, and the rest of the loop continues
4. What is the difference between typeof and instance of
Typeof: determines the typeof the object. There are six possible return values
Instance of: Checks whether it is the instantiated object of the peer. The return value is true or false
5. What is the difference between a GET request and a POST request
In a GET request, parameters are placed in the URL, while in a POST request, parameters are placed in the request body. Theoretically, POST is more secure because the URL length cannot exceed 1KB. However, IN a GET request, parameters are placed in the URL