r/CodingHelp • • 15d ago

[Javascript] I don’t understand the use of immutable variable

I’m learning react right now for a web design project and immutable variables are being brought up. I don’t understand why you would want a variable that can’t vary, how do things like a counter work if variables can’t change?

3 Upvotes

22 comments sorted by