百度春招前端一面

介绍自己

怎么接触的前端,怎么学习的前端

实习项目相关,背景痛点,技术难点

执行流程题

var name = 'global';
function test(){
  console.log(name);//undifined
  var name = 'local';
}
test();
var name = "mary";
function hello() {
  console.log(name);
}
function hello1() {
  var name = "bob";
  hello();
}
function hello2() {
  var name = "john";
  function hello(){
    console.log(name);
  }
  hello();
}

hello(); // mary
hello1(); // mary
hello2(); // john

//浏览器环境
var a = 20;

function test() {
  this.a = 10;
  setTimeout(() => {
    console.log(this.a);
    setTimeout(function () {
      var a = 30;
      console.log(this.a);
    }, 100);
  }, 100);
}

test(); // 10 10
let func = new test();// 10 10

事件循环输出题

手写:可以控制层级的flat方法

全部评论
佬,有消息吗
点赞 回复 分享
发布于 今天 16:59 广东

相关推荐

03-04 14:31
门头沟学院 Java
点赞 评论 收藏
分享
评论
2
2
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务