- Notifications
You must be signed in to change notification settings - Fork173
함수 VS객체 리터럴 VS정적 클래스 VS클래스 인스턴스를 export#152
toothlessdev started this conversation inA vs B
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
안녕하세요! 예를들어, 단순히
exportfunctionCounter(){letcount=0;return{increase:function(){count+=1;},decrease:function(){count-=1;}};}
exportconstCounter={count:0,increase(){this.count++;},decrease(){this.count--;},};
exportclassCounter{staticcount=0;publicstaticincrease(){this.count++;}publicstaticdecrease(){this.count--;}}
classCounter{privatecount=0;publicincrease(){this.count++;}publicdecrease(){this.count--;}}exportconstcounter=newCounter(); 개인적으로 비교해 보았을 때에는
다른 개발자 분들은 자신만의 기준이 있는지 궁금하여 여쭤봅니다! |
`함수` VS `객체 리터럴` VS `정적 클래스` VS `클래스 인스턴스를 export` 함수를 선호한다 37% 객체리터럴을 선호한다 32% 정적 클래스를 선호한다 5% 클래스 인스턴스를 export 하는 방식을 선호한다 16% 나만의 기준이 있다 7% 53 votes· |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
오... 제 케이스를 돌아보면 다른 분들 케이스도 궁금하네요 |
BetaWas this translation helpful?Give feedback.
All reactions
👍 5
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment