1. The es6 in the generator
Generator is an es6 asynchronous programming solution for simple applications as follows:
function* helloWorldGenerator() {
yield 'hello';
yield 'world';
return 'ending';
}
let hw = helloWorldGenerator();
console.log(hw.next());
console.log(hw.next());
console.log(hw.next());
console.log(hw.next());
Copy the code
Use the following points:
- Synchronous expression of asynchronous operations
- Control flow management
- Deploy the Iterator interface
- As a data structure
2. What is the options pre-request
(1). Pre-request exists in both GET and POST (2). What is pre-request pre-query server support request method, determine whether the request is allowed
3. HTTPS encryption process
https = http + SSL; HTTPS is more secure than HTTP, mainly SSL; HTTPS uses SSL asymmetric encryption (RSA) before data is transmitted. After the encryption is complete, symmetric encryption (AES) can be used for data transmission. The encryption process is as follows:
4. If call,apply is passed to null, what is this?
function test () {
console.log(this);
}
test.apply(window); // Window
test.apply(null); // Window
test.apply(undefined); // Window
test.apply(); // Window
test.call(window); // Window
test.call(null); // Window
test.call(undefined); // Window
test.call(); // Window
Copy the code
5. How is hot Module of Vue implemented?
6. for… in, for, for… Of the difference?
(1). In form: In forin, key is the attribute name and forof is the value (2). Forinhi traverses the attributes of the object, including the attributes on the prototype; But forof does not iterate over properties on prototypes, nor can it loop over ordinary objects (3). Forin does not iterate over maps and sets; forof does