Suppose I have code like this:
var moduleVar = "I belong to this module, you could also call me a static var";
var ClassName = function() {
var instanceVar = "I belong to this instance";
function someFunction(functionVar) {
var anotherFunctionVar = "I belong to this function";
return 1;
}
}
module.exports = ClassName;
I looked at the naming conventions for node, but I did not find anything that even related to this problem. I like the prefix of instance variables with underscores (like "_instanceVar"), but I still stick to the difference between the function and the module variables.
Is there a naming rule that distinguishes them?
source
share