乐趣区

关于前端:选择篇041下面代码的输出是什么

const person = {name: 'Lydia'}

function sayHi(age) {console.log(`${this.name} is ${age}`)
}

sayHi.call(person, 21)
sayHi.bind(person, 21)
  • A: undefined is 21 Lydia is 21
  • B: function function
  • C: Lydia is 21 Lydia is 21
  • D: Lydia is 21 function

参考答案

退出移动版