Samuel
@samuel.fm
I think typescript should add interrobang chaining you can do obj?.prop for optional chaining you can do obj!.prop to assert a optional property exists you should be able to do obj‽.prop to do optional chaining while pretending you didn't
7 4 84
Samuel
no, because if obj is undefined it will error. obj‽prop would be transformed to object?.prop at runtime, but to the type checker would appear as obj!.prop
1 1
Raccoon
I still don’t understand why when it’s an optional string it doesn’t just return an empty string unless specified. Obv if you assert it crashes if nil