- HTTPS和HTTP区别
- HTTPS 连接建立的过程
- CDN 有哪些优化静态资源加载速度的机制?
- 有哪些方式实现 HTTP 请求浏览器缓存?ETag是如何生成的?
- 谈下Promise.race和Promise.all
- 写出一下代码
console
输出顺序
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');
7.请补充完成逻辑
function sum(num) {
// 请你实现
}
const a = sum() // a === 0
const b = sum(6)() // b === 6
const c = sum(4)(5)() // c === 9
const d = sum(1)(1)(1)() // d === 3
...
const k = sum(n1)...(nk)() // n1 + ... + nk
8.请输出二叉树的每个左节点
例
1
/ \
3 5
/ \
4 6
输出 [1, 3, 4]
function TreeNode(val) {
this.val = val;
this.left = null;
this.right = null;
}
function leftView(root) {
// 请你实现
}
- React Fiber 架构?
- React UNSAFE_ ?
- react生命周期函数
- react 自定义 hooks如何使用,需要注意什么?