Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At runtime, TypeScript is JavaScript, so depending on your perspective either encapsulation is impossible (because you don't have types to defend you) or easy (because you use the patterns that JS has to defend encapsulation at runtime, without types).


#private is coming soon, so that won't really be true any more. https://github.com/microsoft/TypeScript/pull/30829

You'll have class members with accessibility in their declaration, and real run-time encapsulation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: