본문 바로가기 메뉴 바로가기

Today I Learned

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Today I Learned

검색하기 폼
  • 분류 전체보기 (124)
    • Network (3)
    • Language (47)
      • Java (24)
      • Javascript (16)
      • Python (3)
      • HTML&CSS (4)
    • Framework (37)
      • Spring (19)
      • Spring Data JPA (8)
      • Express.js (10)
    • Test (1)
    • Database (7)
    • DevOps (14)
    • Git (4)
    • IDE (2)
    • Design Pattern (0)
    • 개발환경 (8)
    • Books (0)
    • ETC (1)
  • 방명록

Prototype (1)
생성자패턴과 prototype

생성자패턴 객체지향적인 방법으로 객체에서 비슷한 속성과 행위를 묶어서 표현할 수 있다. 객체를 동적으로 생성해서 중복을 줄일 수 있다. prototype에 메서드를 속성으로 추가할 수 있다. 객체리터럴(Object literal) 코드의 중복이 발생한다. var healthObj = { name : "seogineer", lastTime : "PM 10:12", showHealth : function(){ console.log(this.name + "님, 오늘은 " + this.lastTime + "에 운동을 하셨네요."); } } var healthObj2 = { name : "crong", lastTime : "AM 09:10", showHealth : function(){ console.log(th..

Language/Javascript 2021. 1. 17. 23:51
이전 1 다음
이전 다음
Total
Today
Yesterday
링크
  • Github
  • 이력서
Apple 2023 맥북 프로 14 M3, 스페이스 그레이, M3 8코어, 10코어 GPU, 512GB, 8GB, 한글

Blog is powered by Tistory / Designed by Tistory

티스토리툴바