Naming convention for distinguishing between module / instance / method variables in node JS

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?

+4
source share
1 answer

, /. "", , - . , vars, ., !

- : http://www.j-io.org/Javascript-Naming_Conventions/#naming-conventions

"private". , "my *" "m_" javascript - , - , .

, , , , ! , , , camelCase, ( :)

: JSHint. jslint, . , ( :)

+4

All Articles