jaswanth03
12/27/2018 - 12:34 PM

How to make a real copy of a JavaScript Array with Objects (without a reference)

How to make a real copy of a JavaScript Array with Objects (without a reference) As angular have pass by reference if a value is changed in the original array the data in the duplicate array will also change.

var duplicateObject = JSON.parse(JSON.stringify( originalObject ));