Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问js这段具体什么问题 #17

Open
lzh1104 opened this issue Jun 6, 2018 · 0 comments
Open

请问js这段具体什么问题 #17

lzh1104 opened this issue Jun 6, 2018 · 0 comments

Comments

@lzh1104
Copy link

lzh1104 commented Jun 6, 2018

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;
    };
};

请给出建议写法,,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant