logo

JavaScript questions (4)

What are the pros and cons of immutability?

Pros
  • Easier change detection - Object equality can be determined in a performant and easy manner through referential equality. This is useful for comparing object differences in React and Redux.
  • Programs with immutable objects are less complicated to think about, since you don't need to worry about how an object may evolve over time.
本章目录