Polymer Clone Objects
问题 How can we clone an object in Polymer? Example this.colorsAsc.push({color: 'red'}); this.colorsDesc = this.colorsAsc.reverse(); this.colorsDesc[0].color = 'blue'; // Both will be blue doing this I can do it in these many functionalities What is the most efficient way to deep clone an object in JavaScript? but I wonder if there is a way in Polymer to do that? Angular does it https://docs.angularjs.org/api/ng/function/angular.copy 回答1: You can try the following hack: this.colorsDesc = JSON