Re:Returning to JavaScript After 5 Years
by pluma on Saturday January 07, 2017 @06:43PM
(#13347357)
The semantics of 'this' in TS are the same as in JS and they're only a problem if you expect TS to be Java rather than JS.
[ Parent
| on HN ]
Re:Returning to JavaScript After 5 Years
by ClayFerguson on Sunday January 08, 2017 @01:35AM
(#13348627)
I use the '=>' operator to get a 'this' reference that does what you'd expect (like in Java) by getting whatever object is running rather than the typical JS 'this' of the function. Trivial example is here:
https://github.com/Clay-Ferguson/meta64/blob/master/src/main...