|
|
|
|
|
by mryall
5783 days ago
|
|
Avoiding something you don't understand might seem like a good idea when programming, but if it's a core part of the language you're using -- like 'this' in JavaScript -- trying to understand it and use it appropriately is actually a much better approach. I've seen JS code that tries to avoid using 'this', and it often ends up a lot more complicated and tightly coupled than code which uses it appropriately. The behaviour of 'this' in JavaScript is different to Java and other OO languages, but it isn't that complicated to understand. |
|