{"componentChunkName":"component---src-templates-blog-post-js","path":"/JavaScript/Prototype_Chaining/","result":{"data":{"site":{"siteMetadata":{"title":"JULog","author":"[Ju Chan Hwang]","siteUrl":"https://julog.netlify.app","comment":{"disqusShortName":"","utterances":"JuChanHwang/gatsby-starter-bee"},"sponsor":{"buyMeACoffeeId":"jbee"}}},"markdownRemark":{"id":"0fb676ac-3ec1-50f9-afda-ab00936d2ea9","excerpt":"배열 리터럴은  Array생성자 함수와 그 프로토타입으로 이루어져 있다. Array.prototype에는 배열 메소드가 모두 담겨있다. Array의 prototype은 객체이다. 가 생략 가능하기 때문에 배열 인스턴스가 마치 자신의 메소드인 것처럼 호출이 가능하다.  즉, Object 생성자 함수의 new 연산자로 생성된 인스턴스이다.  따라서  Object의 prototype을 상속 받는다. 배열은 Object.prototype…","html":"<p>배열 리터럴은  Array생성자 함수와 그 프로토타입으로 이루어져 있다. Array.prototype에는 배열 메소드가 모두 담겨있다. Array의 prototype은 객체이다. <code class=\"language-text\">__proto__</code>가 생략 가능하기 때문에 배열 인스턴스가 마치 자신의 메소드인 것처럼 호출이 가능하다. </p>\n<img width=\"600\" alt=\"스크린샷 2020-06-15 오후 11 44 34\" src=\"https://user-images.githubusercontent.com/36187948/84671356-3d666d00-af62-11ea-87ce-14ca7da24fea.png\">\n<p>즉, <strong>Object 생성자 함수의 new 연산자로 생성된 인스턴스</strong>이다.  따라서  Object의 prototype을 상속 받는다. 배열은 Object.prototype에 있는 메소드를 마치 자신의 것처럼 사용할 수 있다. 이처럼 <code class=\"language-text\">__proto__</code> 라는 빨간 선을 따라서 연결된 것을 <strong>프로토타입 체이닝</strong>이라한다.</p>\n<img width=\"600\" alt=\"스크린샷 2020-06-21 오후 3 17 11\" src=\"https://user-images.githubusercontent.com/36187948/85218141-52178a80-b3d2-11ea-9add-a21bbda91e6d.png\">\n<p>Object.prototype에는 자바스크립트 전체를 통괄하는 공통된 메소드들이 있다.</p>\n<ul>\n<li>hasOwnProperty()</li>\n<li>toString()</li>\n<li>valueOf()</li>\n<li>isPrototypeOf()</li>\n</ul>\n<p>이 메소드들은 모든 데이터타입이 프로토타입 체이닝을 통해서 접근할 수 있다.</p>\n<blockquote>\n<p>참고 및 출처</p>\n<ul>\n<li><a href=\"https://www.inflearn.com/course/%ED%95%B5%EC%8B%AC%EA%B0%9C%EB%85%90-javascript-flow\">Javascript 핵심 개념 알아보기</a></li>\n</ul>\n</blockquote>","frontmatter":{"title":"Prototype Chaining","date":"June 15, 2020"}}},"pageContext":{"slug":"/JavaScript/Prototype_Chaining/","previous":{"fields":{"slug":"/JavaScript/Server_Side_Rendering/"},"frontmatter":{"title":"서버 사이드 렌더링(SSR)","category":"JavaScript","draft":false}},"next":{"fields":{"slug":"/Today I Learned/css_z-index/"},"frontmatter":{"title":"CSS z-index","category":"Today I Learned","draft":false}}}},"staticQueryHashes":["3128451518","96099027"]}