Aniruddha Das Aniruddha Das - 1 year ago 113
TypeScript Question

what is the difference between thin arrow (->) and fat arrow ( => ) in typescript

In typescript there are two kind of arrow function, one is => (fat arrow) and another (->)thin arrow. My understanding is => function is used to to to use this scope and internal Closure. What the -> (thin arrow ) function do?

Answer Source

The fat arrow => preserves the this of the enclosing context. Otherwise it behaves like a normal function expression.

The thin arrow -> does not exist.

It sounds like you're using Webstorm, which doesn't always provide 100% accurate error information.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download