Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created November 27, 2017 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seogi1004/be5d5db56e2e4ac5d5af15eb97c72573 to your computer and use it in GitHub Desktop.
Save seogi1004/be5d5db56e2e4ac5d5af15eb97c72573 to your computer and use it in GitHub Desktop.
var MyClass = function() {
this.show = function() {
return "MyClass";
}
}
var MyStaticClass = new function() {
this.show = function() {
return "MyStaticClass";
}
}
var cls = new MyClass();
alert(cls.show());
// -- 별도의 인스턴스 생성을 하지 않는다.
alert(MyStaticClass.show());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment