beginner27 minby DevFox

References vs copies: why changing one object changes another

See why a second box, a parameter or a list leads to the same object rather than a copy, so a change made through one name is seen through every name. Make a real copy with new braces when a change must not reach the original, and tell the two apart with ===.

  • TypeScript
  • Fundamentals
References vs copies: why changing one object changes another. Read this lesson at .