let student = {}; let age = undefined; Object.defineProperty(student, 'age', { get: function() { // 获取该属性时触发 return age; }, set: function(val) { // 设置该属性值时触发 age = val; } }); student.age = 20; console.log(student.age); // 20
let student = new Proxy( {}, { get: (obj, prop) => { // 获取该属性时触发 return obj[prop]; }, set: (obj, prop, value) => { // 设置该属性值时触发 obj[prop] = value; return true; } } ); student.age = 20; console.log(student.age); // 20
【持续维护/更新 500+前端面试题/笔记】https://github.com/noxussj/Interview-Questions/issues
【大数据可视化图表插件】https://www.npmjs.com/package/ns-echarts
【利用 THREE.JS 实现 3D 城市建模(珠海市)】https://3d.noxussj.top/