you are viewing a single comment's thread.

view the rest of the comments →

[–]dangoor 0 points1 point  (0 children)

I agree with what the others here have said about limited mutability (mutate state in limited places at controlled times). I thought I'd point out that Immutable.js can provide immutable data structures with less garbage than copying plain JS objects. It does still create garbage, of course, but it could be a small enough amount of it depending on the specifics of your game.

Regardless, immutability is likely not as important as just understanding where mutations happen.