美团-到店
约 526 字大约 2 分钟
2024-04-06
- 自我介绍
- Js 变量类型检测如何检测?
- 浏览器缓存策略
- Js 作用域的概念?
- 请给出输出结果
<script>
function foo(){
console.log(a);
}
function bar() {
var a = 3;
console.log(this.a + a);
foo();
}
var a = 2;
bar();
bar.call({a: 4})
</script>- 请给出输出结果
console.log('1');
async function async1() {
console.log('2');
await console.log('3');
console.log('4');
}
setTimeout(function () { console.log('5') }, 0)
async1();
new Promise(function (resolve) {
console.log('6');
resolve(6);
}).then((x) => x + 6)
.then((x) => { throw new Error('My Error') })
.catch(() => 6)
.then((x) => x + 6)
.then((x) => console.log(x))
.catch(console.error('error')) // 注意这里不是回调
console.log('8')- 多维数组转一维数组
const oldArr = [1, 2, [3, 4]];
const newArr = flat(oldArr);
console.log(newArr); // [1, 2, 3, 4]手写了三种方式:递归、reduce、toString()方式等
通过JS计算本月最后一个周日是几号? 直接说思路,不手写
css 标准盒模型是怎样的,如何改变 css 盒模型? 实现两列布局,左列固定宽度,右列宽度自适应。(请给出 flex 的实现方案 和 一种非 flex 的实现方案) 直接说思路,不手写
二面
- 自我介绍
- 自己选一个项目详细介绍下
- vue原理(介绍的数图)
- 数图印象最深刻是什么?
- 课件编辑器项目做了一个pptx-parser的转换包,介绍一下
- 超级课堂都做了哪些事情?收缩耗时资源,优化编译引擎模板介绍一下。
- webpack都做了哪些处理?
- 进行了tree-shaking处理,那原理知道吗?
- webpack-merge包产生了歧义,需要下去了解。
- vue的render了解吗?
- https
- 自己觉得最了得的知识点(说了http,重点是h1和h2)
- 有没有看过一些源码
- 对自己的一些规划
- 封装一个run函数
var fn1 = function(a, cb){
setTimeout(()=>cb(a + 2), 300)
}
var fn2 = function(a, cb){
setTimeout(()=>cb(a + 3), 200)
}
var fn3 = function(a, cb){
setTimeout(()=>cb(a * 2), 100)
}
var fnArr = [fn1, fn2, fn3];
run(1, fnArr, function(res){
console.log(res) // 这里会打印出12。// 12 = (1+2+3)*2
})