2 ms·
This example from the article looks like an argument for immutability to me. interface A { x: number; } let a: A = {x: 3} let b: {
by lets-surf 7y ago
This example from the article looks like an argument for immutability to me.
interface A {
x: number;
}
let a: A = {x: 3}
let b: {x: number | string} = a;
b.x = "unsound";
let x: number = a.x; // unsound
a.x.toFixed(0); // WTF is it?
- SpaceNugget 7y agoKind of, you can't have your cake and eat it too. When it comes to typing systems you have to pick 2: Depth, Mutability, Soundness