|
|
|
|
|
by aufreak3
4914 days ago
|
|
This is why I avoid using "this". Placing this comment next to any of the 9 points causes the comment to mean something different. However, "this" could be useful in circumstances where that is the exact effect desired. Even in such cases, the relevant object can be made explicit as an argument. Some time back, I had to explain to some people how to think about "traditional OO" in JS, which I tried to make systematic in a post [1]. (Not trying to self promote here, but most other presentations I've seen start with the prototype mechanism. "this" is not brought in until much later in the post.) [1] http://sriku.org/blog/2012/04/12/classes-and-javascript/ [edit: fixed typo] |
|