3 ms·
An often overlooked feature of OOP is the use of pseudo-variable 'this' (or 'self in Smalltalk). That is about name-scope. You can refer to your own method si
by galaxyLogic 4y ago
An often overlooked feature of OOP is the use of pseudo-variable 'this' (or 'self in Smalltalk).
That is about name-scope. You can refer to your own method simply by its name via 'this', and when you call it you know it can access the state inside that particular object.
Without 'this' an object in JavaScript and other OOP languages could not access its own properties including it (possibly mutable) state.
Is there an equivalent to 'this' in purely FP languages?