Hacker News new | ask | show | jobs
by ixtraz 4749 days ago
You're absolutely right. I'm an C# dev who switched to JavaScript stack and using TypeScript already for 5-6 months. It was just a first-look description for the TypeScript.

Btw, TypeScript also aiming to fix context problem so in callbacks 'this' keyword is always related to parent class.

1 comments

`this` being dynamically bound is a feature, it's broken as intended. You can always `bind` a function to remedy this if it's a problem for you.
Why would it be a feature? It is almost never the desired outcome, thus a terrible default.