I have a question regarding the spread syntax and an array of objects.
Having an array of objects like:
const array = [{age:50}, {age:27}]
According to this answer: https://stackoverflow.com/a/54138394/6781511, using the spread syntax will result in referencedArray
having a shallow copy of array
.
const referencedArray = [...array]
What then is the difference between using the spread syntax and not using it?
const referencedArray = [...array]
vs
const referencedArray = array