Is the underscore prefix in JavaScript only a convention, like for example in Python private class methods are?
From the 2.7 Python documentation:
"Only conventions? Or is there more behind the underscore prefix?"
Apart from privacy conventions, I also wanted to help bring awareness that the underscore prefix is also used for arguments that are dependent on independent arguments, specifically in URI anchor maps. Dependent keys always point to a map.
Example ( from https://github.com/mmikowski/urianchor ) :
$.uriAnchor.setAnchor({
page : 'profile',
_page : {
uname : 'wendy',
online : 'today'
}
});
The URI anchor on the browser search field is changed to:
\#!page=profile:uname,wendy|online,today
This is a convention used to drive an application state based on hash changes.