[Vuejs]-Array dependency in vue.js

0👍

You’re copying the original array by reference, meaning the two arrays are pointing to the same place in memory, ie they’re both the same array. You want to copy by value. In your case, you would want to do array_2 = JSON.parse(JSON.stringify(arr)). More on that here https://stackoverflow.com/a/23536726/3401008

Leave a comment