본문 바로가기

코딩쌀롱

검색하기
코딩쌀롱
프로필사진 이브✱

  • 모든 글 (126)
    • 개발공부 (70)
    • 책 (10)
    • 회고 (43)
      • 하루 기록 (25)
      • 회고 (18)
    • 아무것 (3)
    • 여행 (0)
Guestbook
Recent Posts
Recent Comments
Today
Total
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Tags
  • 회고
  • array
  • 아티클
  • React
  • Promise
  • bind
  • 생성자
  • closure
  • 프로그래머스
  • input
  • 코어자바스크립트
  • 비동기
  • node.js
  • 알고리즘
  • TS
  • javascript
  • 코드스쿼드
  • leetcode
  • Prototype
  • 링크드 리스트
more
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록프로토타입 체인 (1)

코딩쌀롱

[코어 자바스크립트] 6-2 프로토타입 체인

메서드 오버라이드 const Person = function (name) { this.name = name; }; Person.prototype.getName = function () { return this.name; }; const iu = new Person('지금'); iu.getName = function () { return '바로 ' + this.name; }; console.log(iu.getName()); // 바로 지금 prototype에도 getName 메서드가 있고, 인스턴스인 iu에도 getName 메서드가 있다. iu.getName()을 호출하면 어떤 메서드를 실행할까? 자바스크립트 엔진이 메서드를 찾는 방식은 가장 가까운 대상인 자신의 프로퍼티를 검색하고, 없으면 그 다음으로 ..

책 2020. 12. 30. 17:55
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바