Currently I am using angular 2 and in my typescript file I have an object like this.
chartData: any
chartData has result array and each result is channel array
so chartData.result[0].channels[4], this is what we get initally
I want to push result[0] into result[1] and change channels[0].id = "New" and I am trying like
this.chartData.result.push(this.chartData.result[0]);
this.chartData.result[1].channels[0].id = "New"
When I am doing this, it changes id of channels[0] of both result[0] and result[1], why is this happening when I am trying to change only result[1] object.