3 ms·
> How do you do for loops then? Take a look at JavaScript for-of loops or the various array methods in JS. As to the benefit of immutability, it removes a lot
by schwartzworld 4y ago
> How do you do for loops then?
Take a look at JavaScript for-of loops or the various array methods in JS.
As to the benefit of immutability, it removes a lot of the mental overhead from programming. Once a variable is set, you know it's value will never change. This eliminates lots of sources of bugs.
- abudabi123 4y agoThere are fewer syllables in "constant" than "immutable variable".
- schwartzworld 4y agoCool but kind of irrelevant since they aren't the same thing. https://softwareengineering.stackexchange.com/questions/149555/difference-between-immutable-and-const https://softwareengineering.stackexchange.com/questions/1495...