腾讯云CSIG一面凉经

鼠鼠全程被吊打了呜呜呜

  1. 自我介绍+项目拷打-人麻了
  2. 微应用是怎么做的样式隔离
  3. scoped是怎么做到的样式隔离?
  4. 选择器的优先级
  5. vuex流程
  6. vue2的数据绑定
  7. 点击按钮会触发什么事件?浏览器后台是怎么运行的
  8. click是不是原子事件
  9. 看题写输出,第一题就g了

代码题

第一题

const arrFuncs = []; // 1

for (var i = 0; i < 5; i++) {
  arrFuncs.push(function () {
    return i; 
  });
}

console.log(i); 
for (let i = 0; i < arrFuncs.length; i++) {
  //5
  console.log(arrFuncs[i]()); 
}

第二题

function hoistFunction() {
  foo();

  var foo = function () {
    console.log(1); 
  };

  foo();

  function foo() {
    console.log(2);
  }

  foo();
}
foo(); 
hoistFunction();

第三题

console.log("1");
setTimeout(function () {
  console.log("2");
  new Promise(function (resolve) {
    console.log("4");
    resolve();
  }).then(function () {
    console.log("5");
  });
});
new Promise(function (resolve) {
  console.log("7");
  resolve();
}).then(function () {
  console.log("8");
});
setTimeout(function () {
  console.log("9");
  new Promise(function (resolve) { 
    console.log("11");
    resolve();
  }).then(function () {
    console.log("12");
  });
});

第四题是一个HTML文件,写的Vue或者React的实现的一个计算器,但是有错误,解决报错问题。

全部评论

相关推荐

点赞 1 评论
分享
牛客网
牛客企业服务