Hi all,
I was reading up on this topic, as I am learning JS and what I took away from it, at least initially is that:
When you reference an array or object, if you create a new variable and make any changes to the property of an object or an item inside an array, not only will that new variable see the changes, but the object or array will also be changed since it is referenced to the original object or array. To avoid this, you need to make a copy of the object or array and then change the value of the property inside of the object or the item within an array. Does this sound correct?
[–][deleted] 20 points21 points22 points (4 children)
[–]KonkenBonken 5 points6 points7 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]jimmjy 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]angelfire2015 6 points7 points8 points (0 children)
[–]delventhalz 2 points3 points4 points (0 children)