广州嘉为科技前端面经
自我介绍
TCP/UDP
HTTP1/HTTP2
watch/watchEffect
js 事件循环
let、const、var 的区别
什么是闭包
闭包有什么用
闭包缺点
typescript 中 interface 和 typeof 的区别
typescript 中类型工具 Omit 和 exclude
怎么封装一个按钮组件
实习项目
寿司代码输出题
question1
for(let i = 0; i < 2; i++){
setTimeout(() => {
console.log(i)
},100)
}
//0,1
for(var j = 0; j < 2; j++){
setTimeout(() => {
console.log(j)
},100)
}
//2 2
question2
//q2
console.log("start")
setTimeout(() => {
console.log("s1")
},0)
setTimeout(() => {
console.log("s2")
},0)
Promise.resolve().then(() => {
console.log("promise1")
}).then(() => {
console.log("promise2")
})
console.log("end")
// start,end,promise1,promise2,s1,s2
寿司回文串
共享屏幕,做着做着发现自己的 copilot 没有关(在写之前已经关了),面试官:能不能先把 copilot 关了 内心 os:忘记关了就是开了是吧
const func = (str) =>{
const len = str.length
for(let i = 0,j = len - 1; j <=i ; i++,j--){
if(str[i] !== str[j]) return false
}
return true
}
总结:面的都是八股,鼠鼠有些没有准备好,昨晚奋战复习到凌晨 4 点钟,累坏了,如果有后续就更新。
#牛客创作赏金赛#