说了先作出整体页面再抽组件,面试官可能觉得先写组件像搭积木一样搭出来更合理。
console.log(1) // 1
new Promise((resolve) => {
console.log(2) // 2
resolve()
setTimeout(() => {
console.log(3)
}, 1000);
}).then(() => {
console.log(5) // 微任务1
new Promise(resolve => {
console.log(6) //
}).then(() => {
console.log(7)
}).then(() => {
console.log(8)
})
}).then(() => {
console.log(9) //
})
setTimeout(() => {
console.log(10)
}, 1000);
setTimeout(() => {
console.log(13) //
}, 1000);
setTimeout(() => {
console.log(14) //
}, 500);
setTimeout(() => {
console.log(4)
}, 0);
console.log(11)
let arr = [
{ id: 1, name: '部门1', pid: 0 },
{ id: 2, name: '部门2', pid: 1 },
{ id: 3, name: '部门3', pid: 1 },
{ id: 4, name: '部门4', pid: 3 },
{ id: 5, name: '部门5', pid: 4 },
]
转换成tree
[
{
"id": 1,
"name": "部门1",
"pid": 0,
"children": [
{
"id": 2,
"name": "部门2",
"pid": 1,
"children": []
},
{
"id": 3,
"name": "部门3",
"pid": 1,
"children": [
{
"id": 4,
"name": "部门4",
"pid": 3,
"children": [
{
"id": 5,
"name": "部门5",
"pid": 4,
"children": []
}
]
}
]
}
]
}
]
12.8上午收到消息,二面通过 约了12.9下午二面
12.9上午 因为接了momenta的offer,这边就主动终止流程啦,安心run北京
好朋友内推的,很喜欢蔚来的面试官,希望不后悔自己的选择~
#前端web开发#