Yeah, but shouldn't it use: const z = 'hello' and then get the shape {text: 'hello'} automatically?
Why use "let" along with "as const" instead of mere "const x = 'hello'" for that?
Why use "let" along with "as const" instead of mere "const x = 'hello'" for that?
This is different to the widening of value types within objects, which is a tradeoff made towards unsoundness with the belief that it would otherwise make interoperability with existing js too difficult, for which `as const` now serves as a way to explicitly opt into sounder behavior.