top | item 5903974

(no title)

ixtraz | 12 years 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.

discuss

order

klibertp|12 years ago

`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.

lucian1900|12 years ago

Why would it be a feature? It is almost never the desired outcome, thus a terrible default.