Your "Private Feature # 1" is not private. While version number 2 is closed and, therefore, really only available through your User object.
Often there is no โbestโ, but in this case, a closed function is completely hidden from the outside world (which is obviously better).
There are still rumors that circuits create memory leaks, which is simply wrong. Closing does not create a memory leak, but the programmer does / can. Your example here is completely perfect.
To have private methods, you have to use an almost exact template.
var myObject = function() {
source share