코드의 구조화와 확장성 높이기 #132
seonae-j
started this conversation in
JavaScript
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
만약 print 객체 (const로 정의된 상수)가 있다고 했을 때, 이 코드를 나중에 확장성 있게 사용한다면?
이 코드를 한번 더 freeze 객체로 생성하여 선언해준다.
이렇게 하는 이유는 저 message 객체에 print 뿐만 아니라 다른 속성이나 메시지가 추가되어 출력될 수도 있기 때문이다.
Beta Was this translation helpful? Give feedback.
All reactions