选择篇(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 21Lydia is 21 - B:
functionfunction - C:
Lydia is 21Lydia is 21 - D:
Lydia is 21function

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论