let a = {}; Object.defineProperty(a,'b',{ get:function(){ console.log('get runs') return this.value }, set:function(newval){ console.log('set runs'); this.value = newval } }) a.b = [1,2,3]; //set runs a.b.push(5); // get runs