CodeGuide icon indicating copy to clipboard operation
CodeGuide copied to clipboard

请问js这段具体什么问题

Open lzh1104 opened this issue 7 years ago • 0 comments

http://alloyteam.github.io/CodeGuide/#js-jshint 这个下边

// not good
var singleton = new function() {
    var privateVar;

    this.publicMethod = function() {
        privateVar = 1;
    };

    this.publicMethod2 = function() {
        privateVar = 2;
    };
};

请给出建议写法,,

lzh1104 avatar Jun 06 '18 02:06 lzh1104