reference type
2022年5月1日小于 1 分钟
reference type
Question
What does the code snippet to the right output by console.log
?
Snippet
const obj = {
msg: 'BFE',
foo() {
console.log(this.msg)
},
bar() {
console.log('dev')
}
}
obj.foo();
(obj.foo)();
(obj.foo || obj.bar)();