3 ms·
> And for `hash.toUpperCase()`, it's a valid program. In a sense, but it's not the program we wanted to write, and types can be a useful way of moving that kin
by dllthomas 2y ago
> And for `hash.toUpperCase()`, it's a valid program.
In a sense, but it's not the program we wanted to write, and types can be a useful way of moving that kind of information around within a program during development.
> TypeScript is not designed to stop you from using string prototype methods on... strings!
No, but it is designed to let me design my types to stop myself from accidentally using string prototype methods on data to which they don't actually apply, even when that data happens to be represented as... strings.