-
Notifications
You must be signed in to change notification settings - Fork 0
/
ad587b6d.a2a2462a.js
1 lines (1 loc) · 46.8 KB
/
ad587b6d.a2a2462a.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{130:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return o}));var a=n(2),i=n(6),r=(n(0),n(173)),b={id:"javascript24",title:"\u0417\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \xabthis\xbb",sidebar_label:"\u0417\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \xabthis\xbb"},c={unversionedId:"javascript24",id:"javascript24",isDocsHomePage:!1,title:"\u0417\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \xabthis\xbb",description:"Fetch API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 JavaScript \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0443 XMLHttpRequest. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c fetch(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Promise.",source:"@site/docs/javascript24.md",slug:"/javascript24",permalink:"/docs/javascript24",editUrl:"https://github.com/facebook/docusaurus/edit/master/website/docs/javascript24.md",version:"current",sidebar_label:"\u0417\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \xabthis\xbb",sidebar:"someSidebar",previous:{title:"\u041a\u043b\u0430\u0441\u0441\u044b",permalink:"/docs/javascript23"},next:{title:"\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",permalink:"/docs/javascript25"}},l=[{value:"<code>this</code> \u0438 \u0435\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438",id:"this-\u0438-\u0435\u0433\u043e-\u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438",children:[{value:"this \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438",id:"this-\u043d\u0435-\u0438\u043c\u0435\u0435\u0442-\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438",children:[]},{value:"\u041d\u0435\u0442 this, \u043d\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432",id:"\u043d\u0435\u0442-this-\u043d\u0435\u0442-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445-\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432",children:[]}]},{value:"<code>\u041b\u0443\u0447\u0448\u0438\u0439 \u044f\u0437\u044b\u043a</code>",id:"\u043b\u0443\u0447\u0448\u0438\u0439-\u044f\u0437\u044b\u043a",children:[{value:"\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 this",id:"\u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435-\u0431\u0435\u0437-this",children:[]},{value:"\u0427\u0438\u0441\u0442\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445",id:"\u0447\u0438\u0441\u0442\u044b\u0435-\u043e\u0431\u044a\u0435\u043a\u0442\u044b-\u0434\u0430\u043d\u043d\u044b\u0445",children:[]},{value:"\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f",id:"\u043e\u0431\u044a\u0435\u043a\u0442\u044b-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f",children:[]},{value:"\u041f\u0430\u043c\u044f\u0442\u044c",id:"\u043f\u0430\u043c\u044f\u0442\u044c",children:[]},{value:"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0435\u0437 this",id:"\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b-\u0431\u0435\u0437-this",children:[]},{value:"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 arguments",id:"\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435-arguments",children:[]}]},{value:"\u0418\u0442\u043e\u0433\u043e",id:"\u0438\u0442\u043e\u0433\u043e",children:[]},{value:"\u0412\u043e\u043f\u0440\u043e\u0441\u044b",id:"\u0432\u043e\u043f\u0440\u043e\u0441\u044b",children:[]},{value:"\u0421\u0441\u044b\u043b\u043a\u0438",id:"\u0441\u0441\u044b\u043b\u043a\u0438",children:[]},{value:"Contributors \u2728",id:"contributors-",children:[]}],p={rightToc:l};function o(e){var t=e.components,b=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},p,b,{components:t,mdxType:"MDXLayout"}),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"Fetch API")," \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 JavaScript \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u0443 ",Object(r.b)("inlineCode",{parentName:"p"},"XMLHttpRequest"),". \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c ",Object(r.b)("inlineCode",{parentName:"p"},"fetch()"),", \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://react-native-village.github.io/docs/javascript24"}),"Promise"),"."),Object(r.b)("p",null,"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 ",Object(r.b)("inlineCode",{parentName:"p"},"this")," \u0438\u0437 JavaScript \u0434\u0435\u043b\u0430\u0435\u0442 \u044f\u0437\u044b\u043a \u043b\u0443\u0447\u0448\u0435!"),Object(r.b)("p",null,"\u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e this ",Object(r.b)("inlineCode",{parentName:"p"},"\u0437\u0430\u0432\u0438\u0441\u0438\u0442")," \u043e\u0442 \u0442\u043e\u0433\u043e, ",Object(r.b)("inlineCode",{parentName:"p"},"\u043a\u0430\u043a \u0431\u044b\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u043d\u0430")," \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0430 \u043d\u0435 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 ",Object(r.b)("inlineCode",{parentName:"p"},"this")," \u0432 JavaScript \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u044f\u0437\u044b\u043a\u0435."),Object(r.b)("h2",{id:"this-\u0438-\u0435\u0433\u043e-\u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438"},Object(r.b)("inlineCode",{parentName:"h2"},"this")," \u0438 \u0435\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"\u041c\u0435\u0442\u043e\u0434\u044b")," \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u043d\u0430\u043b\u0430, \u043d\u0430\u0434 \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f ",Object(r.b)("inlineCode",{parentName:"p"},"this.")),Object(r.b)("p",null,"\u041d\u043e ",Object(r.b)("inlineCode",{parentName:"p"},"this")," \u0442\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 (\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435):"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u0442\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 ",Object(r.b)("inlineCode",{parentName:"li"},"\u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439")),Object(r.b)("li",{parentName:"ul"},"\u0442\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 (callback)"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"this")," \u0442\u0435\u0440\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 ",Object(r.b)("inlineCode",{parentName:"li"},"\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f."))),Object(r.b)("p",null,"\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 ",Object(r.b)("inlineCode",{parentName:"p"},"React"),", \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u0412 \u043e\u0431\u043e\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ",Object(r.b)("inlineCode",{parentName:"p"},"this")," \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),'class SearchForm extends React.Component {\n handleChange(event) {\n const newQuery = Object.freeze({ text: event.target.value })\n this.setState(newQuery)\n }\n\n search() {\n const newQuery = Object.freeze({ text: this.state.text })\n if (this.props.onSearch) this.props.onSearch(newQuery)\n }\n\n render() {\n return (\n <form>\n <input onChange={this.handleChange} value={this.state.text} />\n <button onClick={this.search} type="button">\n Search\n </button>\n </form>\n )\n }\n}\n')),Object(r.b)("p",null,"\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u044d\u0442\u0438\u0445 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043f\u0440\u043e\u0431\u043b\u0435\u043c:")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u043c\u0435\u0442\u043e\u0434 ",Object(r.b)("inlineCode",{parentName:"li"},"bind()")),Object(r.b)("li",{parentName:"ul"},"\u0448\u0430\u0431\u043b\u043e\u043d ",Object(r.b)("inlineCode",{parentName:"li"},"that/self")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438."))),Object(r.b)("h3",{id:"this-\u043d\u0435-\u0438\u043c\u0435\u0435\u0442-\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438"},"this \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438"),Object(r.b)("p",null,"this \u0441\u043e\u0437\u0434\u0430\u0435\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438"),". \u0412\u0441\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b this \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f ",Object(r.b)("inlineCode",{parentName:"p"},"\u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438.")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),"class Timer {\n constructor(callback, interval) {\n this.timerId = 'secret'\n }\n}\n\nconst timer = new Timer()\ntimer.timerId // secret \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0443\u0436\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439\n")),Object(r.b)("h3",{id:"\u043d\u0435\u0442-this-\u043d\u0435\u0442-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445-\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432"},"\u041d\u0435\u0442 this, \u043d\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432"),Object(r.b)("p",null,"\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0443\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 this \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e, \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u043e\u043c?"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 this")," \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e ",Object(r.b)("inlineCode",{parentName:"p"},"\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0439.")," \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 this \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 class,")," \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438,")," \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 ",Object(r.b)("inlineCode",{parentName:"p"},"new,")," \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 ",Object(r.b)("inlineCode",{parentName:"p"},"Object.create().")),Object(r.b)("p",null,"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 ",Object(r.b)("inlineCode",{parentName:"p"},"this")," \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435")," \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432 \u0432 \u0446\u0435\u043b\u043e\u043c"),"."),Object(r.b)("h2",{id:"\u043b\u0443\u0447\u0448\u0438\u0439-\u044f\u0437\u044b\u043a"},Object(r.b)("inlineCode",{parentName:"h2"},"\u041b\u0443\u0447\u0448\u0438\u0439 \u044f\u0437\u044b\u043a")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"JavaScript")," \u2014 \u044d\u0442\u043e \u0438 ",Object(r.b)("inlineCode",{parentName:"p"},"\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a")," \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u044f\u0437\u044b\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432. \u0415\u0441\u043b\u0438 \u043c\u044b ",Object(r.b)("inlineCode",{parentName:"p"},"\u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 this,")," \u0443 \u043d\u0430\u0441 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f JavaScript \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u0436\u0435 \u043b\u0443\u0447\u0448\u0435."),Object(r.b)("p",null,"\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, ",Object(r.b)("inlineCode",{parentName:"p"},"\u0431\u0435\u0437 this")," JavaScript \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f."),Object(r.b)("h3",{id:"\u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435-\u0431\u0435\u0437-this"},"\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 this"),Object(r.b)("p",null,"\u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0431\u0435\u0437 this. \u0423 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u0447\u0438\u0441\u0442\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445"),Object(r.b)("li",{parentName:"ul"},"\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.")),Object(r.b)("h3",{id:"\u0447\u0438\u0441\u0442\u044b\u0435-\u043e\u0431\u044a\u0435\u043a\u0442\u044b-\u0434\u0430\u043d\u043d\u044b\u0445"},"\u0427\u0438\u0441\u0442\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"\u0427\u0438\u0441\u0442\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b")," \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435")," \u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u041b\u044e\u0431\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438. \u0427\u0438\u0441\u0442\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c ",Object(r.b)("inlineCode",{parentName:"p"},"\u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c\u0438"),". \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d ",Object(r.b)("inlineCode",{parentName:"p"},"Object.freeze()")," \u043f\u0440\u0438 \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438."),Object(r.b)("h3",{id:"\u043e\u0431\u044a\u0435\u043a\u0442\u044b-\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f"},"\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"\u041e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f")," \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0439, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043e\u0434\u043d\u043e")," \u0438 \u0442\u043e \u0436\u0435 ",Object(r.b)("inlineCode",{parentName:"p"},"\u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435"),". \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"Timer")," \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f this."),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),"function learnJavaScript() {\n let Timer = (callback, interval) => {\n let timerId\n\n let executeAndStartTimer = () => {\n callback().then(function makeNewCall() {\n timerId = setTimeout(executeAndStartTimer, interval)\n })\n }\n\n let stop = () => {\n if (timerId) {\n clearTimeout(timerId)\n timerId = 0\n }\n }\n\n let start = () => {\n if (!timerId) {\n executeAndStartTimer()\n }\n }\n\n return Object.freeze({\n start,\n stop\n })\n }\n\n let getTodos = () => {\n console.log('call')\n return fetch('https://jsonplaceholder.typicode.com/todos')\n }\n\n const timer = Timer(getTodos, 2000)\n\n return timer.start()\n}\n")),Object(r.b)("p",null,"\u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 timer \u0435\u0441\u0442\u044c \u0434\u0432\u0430 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430:")," ",Object(r.b)("inlineCode",{parentName:"p"},"start")," \u0438 ",Object(r.b)("inlineCode",{parentName:"p"},"stop.")," \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u043e. \u041d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c ",Object(r.b)("inlineCode",{parentName:"p"},"\u0441 \u043f\u043e\u0442\u0435\u0440\u0435\u0439")," this \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a ",Object(r.b)("inlineCode",{parentName:"p"},"\u043d\u0435\u0442 this.")),Object(r.b)("h3",{id:"\u043f\u0430\u043c\u044f\u0442\u044c"},"\u041f\u0430\u043c\u044f\u0442\u044c"),Object(r.b)("p",null,"\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043b\u0443\u0447\u0448\u0435")," \u0432 \u043f\u043b\u0430\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043e\u0431\u044a\u0435\u043a\u0442\u0435-\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0435")," \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435\u043c\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438."),Object(r.b)("p",null,"\u0417\u0430\u0442\u0440\u0430\u0442\u044b \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0439 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u044b\u0441\u044f\u0447 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b. \u041d\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e ",Object(r.b)("inlineCode",{parentName:"p"},"\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f.")," \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f ",Object(r.b)("inlineCode",{parentName:"p"},"\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f")," \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 ",Object(r.b)("inlineCode",{parentName:"p"},"\u0437\u0430\u0442\u0440\u0430\u0442 \u043f\u0430\u043c\u044f\u0442\u0438.")),Object(r.b)("p",null,"\u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0442\u043d\u0438 \u0438\u043b\u0438 \u0442\u044b\u0441\u044f\u0447\u0438 ",Object(r.b)("inlineCode",{parentName:"p"},"\u0447\u0438\u0441\u0442\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432")," \u0434\u0430\u043d\u043d\u044b\u0445. \u0427\u0438\u0441\u0442\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f"),", \u043f\u043e\u044d\u0442\u043e\u043c\u0443 ",Object(r.b)("inlineCode",{parentName:"p"},"\u043d\u0435\u0442 \u0437\u0430\u0442\u0440\u0430\u0442 \u043f\u0430\u043c\u044f\u0442\u0438.")),Object(r.b)("h3",{id:"\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b-\u0431\u0435\u0437-this"},"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0435\u0437 this"),Object(r.b)("p",null,"this \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 ",Object(r.b)("inlineCode",{parentName:"p"},"React")," \u0438\u043b\u0438 ",Object(r.b)("inlineCode",{parentName:"p"},"Vue"),". \u0412 ",Object(r.b)("inlineCode",{parentName:"p"},"React")," \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c ",Object(r.b)("inlineCode",{parentName:"p"},"\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b")," \u0431\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f this, \u043a\u0430\u043a ",Object(r.b)("inlineCode",{parentName:"p"},"\u0447\u0438\u0441\u0442\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),"function ListItem({ todo }){\n return (\n <li>\n <div>{ todo.title }</div>\n <div>{ todo.userName }</div>\n </li>\n );\n")),Object(r.b)("p",null,"\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f ",Object(r.b)("inlineCode",{parentName:"p"},"\u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f this")," \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ",Object(r.b)("inlineCode",{parentName:"p"},"React Hooks.")," \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),"import React, { useState } from 'react'\n\nfunction SearchForm({ onSearch }) {\n const [query, setQuery] = useState({ text: '' })\n\n function handleChange(event) {\n const newQuery = Object.freeze({ text: event.target.value })\n setQuery(newQuery)\n }\n\n function search() {\n const newQuery = Object.freeze({ text: query.text })\n if (onSearch) onSearch(newQuery)\n }\n\n return (\n <form>\n <input type=\"text\" onChange={handleChange} />\n <button onClick={search} type=\"button\">\n Search\n </button>\n </form>\n )\n}\n")),Object(r.b)("h3",{id:"\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435-arguments"},"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 arguments"),Object(r.b)("p",null,"\u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"this,")," \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 ",Object(r.b)("inlineCode",{parentName:"p"},"arguments[],")," \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0438\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f."),Object(r.b)("p",null,"\u0418\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e arguments[] \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e. \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 ",Object(r.b)("inlineCode",{parentName:"p"},"...rest.")," \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ",Object(r.b)("inlineCode",{parentName:"p"},"...rest")," \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-jsx",metastring:"live",live:!0}),"function learnJavaScript() {\n let addNumber = (total, value) =>\n total + value\n \n let sum = (...args) =>\n args.reduce(addNumber, 0)\n \n return sum(1, 2, 3, 4, 5, 6, 7) // 28\n}\n")),Object(r.b)("p",null,"\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434 ",Object(r.b)("inlineCode",{parentName:"p"},".reduce"),' \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041d\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e, \u043e\u043d \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0441\u0435\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u2013 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c "\u0441\u0443\u043c\u043c\u0443" \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0435.'),Object(r.b)("h2",{id:"\u0438\u0442\u043e\u0433\u043e"},"\u0418\u0442\u043e\u0433\u043e"),Object(r.b)("p",null,"\u041b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 this \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u2014 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c this!"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"JavaScript")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"JavaScript \u0431\u0435\u0437 this \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f!"))),Object(r.b)("p",null,"\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b ",Object(r.b)("inlineCode",{parentName:"p"},"\u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f this")," \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0439. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ",Object(r.b)("inlineCode",{parentName:"p"},"React Hooks")," \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c ",Object(r.b)("inlineCode",{parentName:"p"},"\u0431\u0435\u0437 this")," \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f."),Object(r.b)("p",null,"\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e ",Object(r.b)("inlineCode",{parentName:"p"},"this")," \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u0438\u0437 ",Object(r.b)("inlineCode",{parentName:"p"},"JavaScript,")," \u0431\u0435\u0437 \u0440\u0430\u0437\u0440\u0443\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c? \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c ",Object(r.b)("inlineCode",{parentName:"p"},"\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434")," \u0431\u0435\u0437 this \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445. \u0422\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 ",Object(r.b)("inlineCode",{parentName:"p"},"ESLint,")," \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u044e\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ",Object(r.b)("inlineCode",{parentName:"p"},"this.")),Object(r.b)("h2",{id:"\u0432\u043e\u043f\u0440\u043e\u0441\u044b"},"\u0412\u043e\u043f\u0440\u043e\u0441\u044b"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},"\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \xabthis\xbb \u044d\u0442\u043e -")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043c\u0435\u0442\u043e\u0434"),Object(r.b)("li",{parentName:"ul"},"\u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438"),Object(r.b)("li",{parentName:"ul"},"\u043d\u0430\u0431\u043e\u0440 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.")),Object(r.b)("ol",{start:2},Object(r.b)("li",{parentName:"ol"},"\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 this:")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u043c\u043e\u0436\u043d\u043e, \u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c"),Object(r.b)("li",{parentName:"ul"},"\u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u043d\u0435 \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e"),Object(r.b)("li",{parentName:"ul"},"\u043d\u0435\u043b\u044c\u0437\u044f, \u0442.\u043a. ",Object(r.b)("inlineCode",{parentName:"li"},"this")," \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d \u0438\u0437 ",Object(r.b)("inlineCode",{parentName:"li"},"JavaScript."))),Object(r.b)("ol",{start:3},Object(r.b)("li",{parentName:"ol"},"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 this:")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u043f\u043e\u043d\u0438\u0436\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430"),Object(r.b)("li",{parentName:"ul"},"\u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430"),Object(r.b)("li",{parentName:"ul"},"\u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.")),Object(r.b)("ol",{start:4},Object(r.b)("li",{parentName:"ol"},"JavaScript \u0431\u0435\u0437 this \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043b\u0443\u0447\u0448\u0438\u0439:")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f"),Object(r.b)("li",{parentName:"ul"},"\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f"),Object(r.b)("li",{parentName:"ul"},"\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.")),Object(r.b)("h2",{id:"\u0441\u0441\u044b\u043b\u043a\u0438"},"\u0421\u0441\u044b\u043b\u043a\u0438"),Object(r.b)("ol",null,Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://webformyself.com/udalenie-klyuchevogo-slova-this-iz-javascript/"}),'\u0421\u0442\u0430\u0442\u044c\u044f "\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \xabthis\xbb \u0438\u0437 JavaScript \u0434\u0435\u043b\u0430\u0435\u0442 \u044f\u0437\u044b\u043a \u043b\u0443\u0447\u0448\u0435"')),Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://habr.com/ru/post/464163/"}),'\u0421\u0442\u0430\u0442\u044c\u044f "\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e this \u0432 JavaScript"')),Object(r.b)("li",{parentName:"ol"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/this"}),'MDN web doc. \u0421\u0442\u0430\u0442\u044c\u044f "this"'))),Object(r.b)("h2",{id:"contributors-"},"Contributors \u2728"),Object(r.b)("p",null,"Thanks goes to these wonderful people (",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://allcontributors.org/docs/en/emoji-key"}),"emoji key"),"):"),Object(r.b)("table",null,Object(r.b)("tr",null,Object(r.b)("td",{align:"center"},Object(r.b)("a",{href:"https://github.com/KoDim-React"},Object(r.b)("img",{src:"https://avatars1.githubusercontent.com/u/72087863?v=4?s=200",width:"200px ",alt:""}),Object(r.b)("br",null),Object(r.b)("sub",null,Object(r.b)("b",null,"Dmitriy K."))),Object(r.b)("br",null),Object(r.b)("a",{href:"#mentoring-KoDim-React",title:"Mentoring"},"\ud83d\udcd6")),Object(r.b)("td",{align:"center"},Object(r.b)("a",{href:"https://fullstackserverless.github.io/"},Object(r.b)("img",{src:"https://avatars0.githubusercontent.com/u/6774813?v=4?s=200",width:"200px ",alt:""}),Object(r.b)("br",null),Object(r.b)("sub",null,Object(r.b)("b",null,"Dmitriy Vasilev"))),Object(r.b)("br",null),Object(r.b)("a",{href:"#financial-gHashTag",title:"Financial"},"\ud83d\udcb5")))),Object(r.b)("p",null,Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://www.patreon.com/bePatron?u=31769291"}),Object(r.b)("img",{alt:"Become a Patron!",src:n(174).default}))))}o.isMDXComponent=!0},173:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return O}));var a=n(0),i=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=i.a.createContext({}),o=function(e){var t=i.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},s=function(e){var t=o(e.components);return i.a.createElement(p.Provider,{value:t},e.children)},j={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},u=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,b=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=o(n),u=a,O=s["".concat(b,".").concat(u)]||s[u]||j[u]||r;return n?i.a.createElement(O,c(c({ref:t},p),{},{components:n})):i.a.createElement(O,c({ref:t},p))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,b=new Array(r);b[0]=u;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,b[1]=c;for(var p=2;p<r;p++)b[p]=n[p];return i.a.createElement.apply(null,b)}return i.a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},174:function(e,t,n){"use strict";n.r(t),t.default=n.p+"assets/images/patreon-15b4e66595efdb2e079faf18b89cff7c.png"}}]);