美文网首页
2020-07-26 字节跳动一面真题

2020-07-26 字节跳动一面真题

作者: 苦庭 | 来源:发表于2020-07-26 17:29 被阅读0次

BD一面真题:
说说position有哪些取值
说说页面居中的方法
说说盒子模型
说说盒子模型的宽度(标准盒模型,怪异盒模型)
说说if([]), if([].length), if({}==={})
说说以下这题的输出

var foo = 1;
function main() {
  console.log(foo);  
  var foo = 2;
  console.log(this.foo);
  this.foo = 3;
}
console.log(foo);
// output: undefined 1 3

一道Promise混杂setTimeout的题

大题:

Q: 实现一个compose函数,支持如下调用:
async function fn1(next){
    console.log(1);
    return next() ;
}
async function fn2(next){
    console.log(2) ;
    await next() ;
    console.log(4) ;
}
async function fn3(next){
    console.log(3) ;
    return next() ;
}

const fn = compose([fn1,fn2,fn3])
fn() ;

输出:1,2,3,4

相关文章

网友评论

      本文标题:2020-07-26 字节跳动一面真题

      本文链接:https://www.haomeiwen.com/subject/xgtglktx.html