3 ms·
You can do that with various constructs without doing OOP style though. Eg: in JS you could use a symbol to store that state that is only known to the methods
by shados 6y ago
You can do that with various constructs without doing OOP style though.
Eg: in JS you could use a symbol to store that state that is only known to the methods allowed to handle he array "internal" state. (JS isn't a great example because there are ways to get access to those hidden symbols when you shouldn't, but it doesn't have to be that way)