DEV Community

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

Collapse
 
rsschouwenaar profile image
Raymon Schouwenaar

Thanks guys for all the questions and answers! But like Alain said, the oldArr.map(x => x) will keep the reference.

Maybe there are other methods like this, but when you want to remove the reference, then this is the only option that I'm aware of ;-)