2 ms·
> JavaScript is an object-oriented languages; use objects! They make async painless. In the example above, you're unable to use ''this'' in the ''dataGot'' fun
by tomp 15y ago
> JavaScript is an object-oriented languages; use objects! They make async painless.
In the example above, you're unable to use ''this'' in the ''dataGot'' function (when invoked as a callback).
Object orientedness is very easy to get wrong in JavaScript, if you're coming from C++/Java/Python background.
- MatthewPhillips 15y agoRight, I excluded the bind for the sake of simplicity. I also forgot that it's this.dataGot. dataGot doesn't exist in that context :)