Javascript - Does changing properties of an object that resides in an array mark the Array as dirty?

Viewed 38

Let's say we have an array of 3 objects. I accessed the second object by index and changed one(or more) property in it. Does this action mark the array as dirty? Does this action change the state of the array? Does this action makes it so that the variable that is holding the array gets a completely new array?

1 Answers

No to all questions, as you don't touch the array, and it holds objects by references, and unless you set a new reference in that index, the Array is fine, you could even freeze it, it's the mutation of the object within the array that might bother some functional purist.

Related