21届校招网易前端一面许愿offer
牛客许愿一手。
1.自我介绍
2.项目说一说用到什么技术
3.ts干啥的
就是跟js一样用,不过提供了更好的报错机制和变量类型
4.es6let const var区别
暂时性死区+不允许重复声明+块级作用域
5.读程序236451
setTimeout(()=>{
console.log(1);
})
console.log(2);
new Promise((resolve)=>{
console.log(3);
resolve();
}).then(()=>{
console.log(4);
}).then(()=>{
console.log(5);
})
console.log(6);6.读程序
Function.prototype.a=()=>{
return 1
}
Object.prototype.b=()=>{
return 2
}
function A(){}
var a=new A();
console.log(a.a());
console.log(a.b());
console.log(A.a());
console.log(A.b());实测第一行会报错,其他的都是正常212
7.promise.all和race
8.先说all的思路,然后手写
function next(resolve,reject) {
arr[i].then((res) => {
result.push(res)
i++
if (i == arr.length) {
resolve(result)
} else {
next()
}
}).catch((res)=>{
reject(res)
})
}9.浏览器缓存相关
expries cache-control last-modified if-modify-since etag if-none-match
10.强缓存返回啥状态码 200 协商304
11.咋学习的,node相关模块...
fs文件读写 net socket相关 http path简化路径
12.react中setState后发生啥
阿忘了忘了,总时长40分钟吧