let BaseObject = { toString(){ return this.str; }, }; let Object1 = {str:"object1"}; Object1.toString = BaseObject.toString; console.log(Object1.toString());