前端每日一题#08

关注公众号 前端人,回复“加群”
添加无广告优质学习群
昨日前端每日一题#07
请选择下列代码的输出结果( )?
Function.prototype.before=function(beforeFn) {
  return () => {
      beforeFn.apply(this, arguments)
      return this.apply(this, arguments)
  }
}
 Function.prototype.after=function(afterFn){
  return () => {
      var ret = this.apply(this, arguments)
      afterFn.apply(this, arguments)
      return ret
  } 
 }
 
 func = function() {
     console.log(2)
 }.before(function(){
     console.log(1)
 }).after(function(){
     console.log(3)
 })
func()
A、2,1,3
B、1,2,3
C、2,3,1
答案:B
今日题目
请选择下列代码的输出结果( )
var a = 1;
function Fn1() {
  var a = 2;
  console.log(this.a + a);
}
function Fn2() {
  var a = 10;
  Fn1();
}
Fn2();
var Fn3 = function () {
  this.a = 3;
};
Fn3.prototype = {
  a: 4,
};
var fn3 = new Fn3();
Fn1.call(fn3);
A.错误
B.3,3
C.2,10
D.3,5
玩法介绍
评论区给出你的答案,并且帮忙点个在看,每天的每日一题答案由下一天给出,欢迎参与每日一题,一周连续答对5题者,周六鬼哥抽取送爱奇艺会员一个
题库小程序
回复 资料包领取我整理的进阶资料包回复 加群,加入前端进阶群console.log("文章点赞===文章点在看===你我都快乐")Bug离我更远了,下班离我更近了 
评论
