var data = { count: 1, value: 2}Object.defineProperty(data, 'count', { enumerable: true, configurable: true, get: function () { console.log('你访问了count', this.count); // 循环读取data.count 导致报错 return this.value }, set: function (newVal) { console.log('你设置了count'); }})console.log(data.count) // 报错 Maximum call stack size exceeded
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)