var obj={ a:'s', } Object.defineProperty(obj, 'a', { set(newValue) { console.log(newValue,'set') }, get() { } }); obj.a='m';