3 ms·
> Both styles still encourage a lot of mutability and complexity throughout the codebase. > You'd get more robustness by managing complexity and state; The to
by lloyd-christmas 10y ago
> Both styles still encourage a lot of mutability and complexity throughout the codebase.
> You'd get more robustness by managing complexity and state;
The top function has a return value of T. That's not encouraging mutability. It's only mutable because JS pass by reference, which is irrelevant to static/dynamic. If you use the return value instead of the passed value, it's "effectively" immutable and is a great way of managing state.