as shown in the figure, a piece of code in the function, countData is a global variable, and the structure is roughly as follows
countData:{[message:[
{time: "2018-08-03"},
{time: "2018-08-03"}
]
],
[photo:[
{time: "2018-08-03"},
{time: "2018-08-07"},
{time: "2018-08-07"},
{time: "2018-08-07"}
]
]}
after the code of the first picture is executed, the processed listData, is obtained and the global variable countData is not equal to the initial countData
after the code of the second graph is executed, the global variable countData of the processed listData, is still the original value, which is the ideal result.
has assigned the global variable to the new variable and does not modify the global variable directly. Why does the code in the first diagram have an impact on the global variable?