Re:Announcing TypeScript 2.0
by lloyd-christmas on Friday September 23, 2016 @01:08PM
(#12566184)
> 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.
> 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.