Skip to content

关于 this 的场景题

js
const User = {
  count: 1,
  getCount: function () {
    return this.count;
  },
};
console.log(User.getCount()); // 1
const func = User.getCount;
console.log(func()); // undefined

基于 MIT 许可发布