Comment by klysm

Comment by klysm 19 hours ago

3 replies

> no one wants the client to throw type errors where the untyped code would have actually worked

That’s not how TypeScript works. You execute it after erasing the types.

ZiiS 15 hours ago

Exactly so all the Browser should do is erase the types. Doing that after you have spent extra time downloading and parsing them is not a useful enough feature to lumber the language with having to get all Browser's to ship each new change.

antihero 19 hours ago

Unless you use enums, of course.

  • jauco 18 hours ago

    Or constructor property initializers.

        constructor(public foo: string){}
    
    Is a typescript feature.