In Python you indicate whether a function/method is private by naming it so that it starts with an _ underscore like this:
def _thisIsPrivate():
return 'a'
def thisIsPublic():
return 'b'
It means that if you have these two functions in a file called dummy.py
and you do something like this:
>>> from dummy import *
>>> thisIsPublic()
'a'
>>> _thisIsPrivate()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name '_thisIsPrivate' is not defined
Seems fair doesn't it. Now is there such similar naming convention and functionality in Javascript?