{"id":374929,"date":"2024-05-21T06:12:23","date_gmt":"2024-05-21T06:12:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=374929"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=374929","title":{"rendered":"<span>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 this \u0432 JavaScript \u0440\u0430\u0437 \u0438 \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 (\u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u0447\u043d\u043e)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0442\u0440\u0438 \u0432\u0435\u0449\u0438: \u043a\u0430\u043a \u0433\u043e\u0440\u0438\u0442 \u043e\u0433\u043e\u043d\u044c, \u043a\u0430\u043a \u0442\u0435\u0447\u0435\u0442 \u0432\u043e\u0434\u0430 \u0438 \u0442\u043e \u043a\u0430\u043a \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440\u044b \u043f\u0438\u0448\u0443\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e this.<\/p>\n<p>\u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a, \u0442\u0435\u043c\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0430\u044f \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u0440\u044b \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 this \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439. \u0415\u0441\u0442\u044c \u0438 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0435\u0440\u043d\u043e, \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0447\u0438\u0441\u0442\u043e \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0432\u043d\u0438\u043a\u0430\u043d\u0438\u044f \u0432 \u0442\u043e \u201c\u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435\u201d. \u0410 \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u0442\u0435\u043e\u0440\u0438\u044e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043f\u043e\u0433\u043b\u0443\u0431\u0436\u0435 \u0441 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 ECMAScript, \u0430 \u0443\u0436\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f this \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<h2>\u0422\u0438\u043f Reference Record<\/h2>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>this<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Reference Record.<\/p>\n<p><strong>Reference Record<\/strong> &#8212; \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 ECMAScript (\u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 \u0442\u0438\u043f\u0430\u043c\u0438 \u0432 JavaScript, \u0438\u043d\u0430\u0447\u0435 \u0437\u0430 \u0432\u0430\u043c\u0438 \u043f\u0440\u0438\u0434\u0435\u0442 \u041c\u0443\u0440\u044b\u0447), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u044f\u0437\u044b\u043a\u0430. \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f: <strong>Base<\/strong>, <strong>ReferencedName<\/strong>, <strong>Strict <\/strong>\u0438<strong> ThisValue<\/strong>. \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043d\u0438\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/p>\n<p><strong>Base <\/strong>&#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 JavaScript, \u043b\u0438\u0431\u043e Enviroment Record (\u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0438\u043f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438).<\/p>\n<p><strong>ReferencedName <\/strong>&#8212; String, Symbol \u0438\u043b\u0438 Private Name.<\/p>\n<p><strong>Strict <\/strong>&#8212; Boolean.<\/p>\n<p><strong>ThisValue <\/strong>&#8212; \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 JavaScript.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, Base \u044d\u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 Enviroment Record (\u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435), ReferencedName \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430, Strict \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 strict mode, \u0430 ThisValue \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c super.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u043b\u044f Strict \u0438 ThisValue \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043d\u0430\u043c \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0442\u0438\u043f\u0443? \u0422\u0443\u0442 \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u043a\u0430\u043a \u0442\u0438\u043f Reference \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <strong>Property Accessor<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 &#8212; <code>obj.name<\/code>, <code>obj[\u2018name\u2019]<\/code> \u0438\u043b\u0438 <code>obj.method()<\/code>. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e this \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0440\u0430\u0437\u0430, \u0447\u0442\u043e this \u0440\u0430\u0432\u043d\u043e \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438, \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u043f\u0440\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4a6\/fdc\/191\/4a6fdc19104803e40ff721ad865f6b76.png\" width=\"602\" height=\"248\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a6\/fdc\/191\/4a6fdc19104803e40ff721ad865f6b76.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0418 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 <strong>Identifier<\/strong>,<strong> <\/strong>\u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c08\/fec\/04f\/c08fec04f2778bc59c902d6ddfe9039e.png\" width=\"1600\" height=\"161\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c08\/fec\/04f\/c08fec04f2778bc59c902d6ddfe9039e.png\"\/><\/figure>\n<\/li>\n<\/ol>\n<p>\u0412\u043e \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 (<code>x + y<\/code>, <code>x ? y : z<\/code>, <code>!x<\/code>) \u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432 (<code>\u201cabc\u201d<\/code>, <code>[1, 2, 3]<\/code> \u0438 \u0442\u0434), \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 person:<\/p>\n<pre><code class=\"javascript\">const person = {   name: \u201cDasha\u201d,   catName: \u201cThomas\u201d, }  person.catName<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0445\u043e\u0434\u044f\u0441\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0443\u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Property Accessor \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>catName<\/code>, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 Reference Record, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">{   Base: person,   ReferencedName: catName, }<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:<\/p>\n<pre><code class=\"javascript\">const cat = \"Thomas\"<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u043e\u0436\u0435 Reference, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">{   Base: global object,   ReferencedName: cat, }<\/code><\/pre>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443 \u043f\u0440\u043e <strong>global object<\/strong> &#8212; \u044d\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 strict mode \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 <strong>window \u0438\u043b\u0438 undefined<\/strong> (\u0432 strict mode). \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0434\u0430\u043b\u0435\u0435 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u043e <strong>global<\/strong>.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Base \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f ReferencedName.<\/p>\n<h2>This \u0438 \u0442\u0438\u043f Reference<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Reference Record, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 this.<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 &#8212; \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 <strong>\u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 Reference, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f Base<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">const person = {   name: \u201cDasha\u201d,   catName: \u201cThomas\u201d,   getCatName() {     return this.catName;   } }  person.getCatName()<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0442\u0438\u043f Reference, \u0433\u0434\u0435<strong> Base \u0440\u0430\u0432\u043d\u043e person<\/strong>,<strong> <\/strong>\u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 <strong>this \u0440\u0430\u0432\u043d\u043e person<\/strong>.<\/p>\n<pre><code class=\"javascript\">const getCatName = person.getCatName  getCatName()<\/code><\/pre>\n<p>\u0410 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435? \u0412\u044b\u0437\u043e\u0432 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 <code>getCatName<\/code> \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u0438\u043f\u0443 Reference, \u0433\u0434\u0435 <strong>Base \u0431\u0443\u0434\u0435\u0442 global<\/strong>, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 <strong>this \u0440\u0430\u0432\u043d\u043e global<\/strong>.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 (isPropertyReference \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430) \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e this \u0438\u0437 Base.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6c\/133\/02e\/b6c13302e39e2e8acbd842a35bc29da0.png\" width=\"1600\" height=\"677\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6c\/133\/02e\/b6c13302e39e2e8acbd842a35bc29da0.png\"\/><\/figure>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442\u0435, \u0442.\u043a. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f PropertyReference, \u0433\u0434\u0435 \u0432 Base \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f Enviroment Record, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f global object.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d78\/156\/b8c\/d78156b8cad9b4b89e4332884d0ff4d4.png\" width=\"1600\" height=\"677\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d78\/156\/b8c\/d78156b8cad9b4b89e4332884d0ff4d4.png\"\/><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u043c ; \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0441\u043a\u043e\u0431\u043e\u043a ;(person.getCatName)(); (false || person.getCatName)(); false || person.getCatName();<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 <code>()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442\u0438\u043f Reference \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 &#8216;Thomas&#8217;.<\/p>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, \u043d\u043e \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>||<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0442\u0438\u043f\u0430 Reference, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 this \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f global. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0441\u0442\u0440\u043e\u0433\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 <code>this.catName<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e this \u0431\u0443\u0434\u0435\u0442 <code>undefined<\/code> \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a <code>undefined.catName<\/code>.<\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043d\u043e \u0431\u0435\u0437 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <code>person.getCatName()<\/code> \u0441 \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u0441 \u0442\u0438\u043f\u043e\u043c Reference, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0435\u0442 &#8216;Thomas&#8217;.<\/p>\n<p>\u042d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e <strong>\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438<\/strong>, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0430\u0437\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c this.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 this \u0432 \u043a\u043e\u043b\u043b\u0431\u044d\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0433\u0434\u0435 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0431\u044d\u043a. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u043f\u0440\u043e <strong>\u0432\u043d\u0435\u0448\u043d\u0435\u0435 API<\/strong>, \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>addEventListener()<\/code> \u0438\u043b\u0438 <code>setTimeout()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 HTML, \u0433\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0430 \u043d\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, this \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043b\u043b\u0431\u044d\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043a\u043b\u0438\u043a\u0430 \u043d\u0430 <code>document<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u0430\u043c <strong>document<\/strong>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u043d\u0430\u0432\u0435\u0448\u0430\u043d \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"javascript\">document.addEventListener('click', function() {   console.log(this) })<\/code><\/pre>\n<p>\u0410 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 forEach this \u0443\u0436\u0435 \u0440\u0430\u0432\u0435\u043d <strong>global<\/strong>:<\/p>\n<pre><code class=\"javascript\">[1, 2, 3].forEach(function() {   console.log(this) })<\/code><\/pre>\n<h2>\u0421\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<p>\u0421\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f this, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u043d\u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u044e\u0442, \u0430 \u0431\u0435\u0440\u0443\u0442 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/529\/e8d\/32e\/529e8d32ef9ae19773ed32c549bef883.png\" width=\"1600\" height=\"251\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/529\/e8d\/32e\/529e8d32ef9ae19773ed32c549bef883.png\"\/><\/figure>\n<p>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>this \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0430, \u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/strong>. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   getCatName: () => {   return this.catName   } }  person.getCatName()<\/code><\/pre>\n<p>\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getCatName<\/code> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 global. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 <code>person.getCatName()<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>undefined<\/code> \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 strict mode.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e?<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   getCatName: () => {     return this.catName   },   wrapperFoo() {     return this.getCatName()   } }  person.wrapperFoo()<\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, this \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getCatName()<\/code> \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a \u0438 \u0433\u0434\u0435 \u043c\u044b \u0435\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c.<\/p>\n<p>\u041d\u043e, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0447\u0442\u043e this \u0432\u043e\u0437\u044c\u043c\u0435\u0442\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0432\u044b\u0437\u043e\u0432 <code>person.wrapperFoo2()<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u2018Thomas\u2019:<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   getCatName: () => {   return this.catName   },   wrapperFoo() {     return this.getCatName();   },   wrapperFoo2() {     return () => {       return this.catName;     }   } }  person.wrapperFoo2()<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f this \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043d\u0435 \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   wrapperFoo() {     return () => {       return this.catName;     }   } }  const foo = person.wrapperFoo()  foo(); \/\/ \u2018Thomas\u2019<\/code><\/pre>\n<p>\u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e \u0442\u0438\u043f Reference \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 this? \u0414\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0430\u043d\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043b\u043b\u0431\u044d\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>bind()<\/code>, <code>call()<\/code> \u0438 <code>apply()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 this \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0427\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d7d\/ad3\/a10\/d7dad3a1038515abbebf3d8a82c4bce1.png\" alt=\"bind()\" title=\"bind()\" width=\"1600\" height=\"112\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d7d\/ad3\/a10\/d7dad3a1038515abbebf3d8a82c4bce1.png\"\/><\/p>\n<div><figcaption>bind()<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/70d\/be2\/86b\/70dbe286bdc5175c0b507ded2a8058d7.png\" alt=\"call() \u0438 apply()\" title=\"call() \u0438 apply()\" width=\"1600\" height=\"78\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/70d\/be2\/86b\/70dbe286bdc5175c0b507ded2a8058d7.png\"\/><\/p>\n<div><figcaption>call() \u0438 apply()<\/figcaption><\/div>\n<\/figure>\n<h2>\u041c\u0435\u0442\u043e\u0434\u044b bind, call, apply<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c this \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u041d\u043e \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043e\u0441\u043e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>bind()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043e\u0441\u043e\u0431\u043e\u0439 <strong>bound function (\u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f)<\/strong>. \u0413\u043b\u0430\u0432\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0432 \u043f\u043e\u043b\u0435 <strong>BoundThis<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/007\/b2c\/868\/007b2c868b73704116971bd930f60ee5.png\" width=\"1600\" height=\"307\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/007\/b2c\/868\/007b2c868b73704116971bd930f60ee5.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"javascript\">const cat = {   name: \u2018Thomas\u2019,   getOwnerName() {   return this.ownerName   } }  const owner = {   ownerName: \u2018Dasha\u2019, }  const boundGetOwnerName = cat.getOwnerName.bind(owner)  boundGetOwnerName()<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 owner \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>bind()<\/code> \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043e\u043d\u0430 \u0432\u044b\u0437\u0432\u0430\u043d\u0430. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>call()<\/code> \u0438 <code>apply()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 <code>bind()<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this:<\/p>\n<pre><code class=\"javascript\">const anotherOwner = {   ownerName: \u201cIlia\u201d, }  boundGetOwnerName.apply(anotherOwner) boundGetOwnerName.call(anotherOwner)<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043a bound function, \u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c this \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/100\/41e\/51b\/10041e51bb2acd26c843cd7875a32f0b.png\" alt=\"call() \u0438 apply()\" title=\"call() \u0438 apply()\" width=\"1600\" height=\"84\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/100\/41e\/51b\/10041e51bb2acd26c843cd7875a32f0b.png\"\/><\/p>\n<div><figcaption>call() \u0438 apply()<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0442\u0438\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0445\u043e\u0437\u044f\u0438\u043d\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u0435\u0433\u043e \u0441\u0432\u044f\u0437\u0430\u043b\u0438. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>bind()<\/code>, \u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>\u0425\u043e\u0442\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 &#8212; \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0434\u043b\u044f <code>bind()<\/code> \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <code>new<\/code>. \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 [[Construct]] \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u0448\u0430\u0433\u0430, \u0433\u0434\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f BoundThis, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 [[Call]]:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/650\/ad1\/30a\/650ad130abcd5dab9d74eb3387a4ab1e.png\" width=\"1600\" height=\"813\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/650\/ad1\/30a\/650ad130abcd5dab9d74eb3387a4ab1e.png\"\/><\/figure>\n<h2>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 new<\/h2>\n<p>\u0421 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c <code>new<\/code> \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e &#8212; <code>this<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">function Cat() {   this.name = \u2018Thomas\u2019 }  const newCat = new Cat() newCat.name \/\/ \u2018Thomas\u2019<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0436\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 new:<\/p>\n<pre><code class=\"javascript\">function Cat() {   console.log(this) }  new Cat() \/\/ {}<\/code><\/pre>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">class Cat {   constructor(name) {     this.name = name   }   getCatName() {     return this.name   } }  const cat = new Cat(\u2018Thomas\u2019) cat.getCatName(); \/\/ Thomas  const cat2 = new Cat(\u2018Lesya\u2019) cat2.getCatName(); \/\/ Lesya<\/code><\/pre>\n<p>\u041d\u043e \u0438 \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432\u043e \u0444\u0440\u0430\u0437\u0435 &#8212; &#171;\u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f&#187;. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e this \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043d\u0438\u043c:<\/p>\n<pre><code class=\"javascript\">function Cat() {   this.name = \u2018Thomas\u2019   return { name: \u2018Lesya\u2019, getName() {       return this.name     }   } }  const newCat = new Cat() newCat.getName() \/\/ \u2018Lesya\u2019, \u0430 \u043d\u0435 \u2018Thomas\u2019<\/code><\/pre>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <strong>super<\/strong>. \u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0434\u0432\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 &#8212; \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c this \u0432\u044b\u0448\u0435 \u0447\u0435\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e super, \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435 &#8212; \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 super, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, super.getName(), this \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f super:<\/p>\n<pre><code class=\"javascript\">class Parent {     constructor() {         this.name = \"Parent\"     }     getName() {         console.log(\"Name:\", this.name)     } }  class Child extends Parent {     constructor() {         super();         this.name = \"Child\"     }     testSuperMethod() {         super.getName()     } }  const child = new Child() child.testSuperMethod()  \/\/ \"Name: Child\", \u0430 \u043d\u0435 \u201cName: Parent\u201d<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 super, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 this \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443.<\/p>\n<p>\u0418 \u043a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0442\u0438\u043f\u0443 Reference. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 super.getName() \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430 Reference \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u044f ThisValue \u0438 Base \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0433\u0434\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0437\u0432\u0430\u043d\u043e super:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/984\/f22\/c77\/984f22c772ac8cf15c6c5bdf4caf551b.png\" width=\"1278\" height=\"378\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/984\/f22\/c77\/984f22c772ac8cf15c6c5bdf4caf551b.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ca\/e3a\/3fb\/0cae3a3fbfa10d24d0d5bdfae97476f5.png\" width=\"1600\" height=\"338\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0ca\/e3a\/3fb\/0cae3a3fbfa10d24d0d5bdfae97476f5.png\"\/><\/figure>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438 \u0447\u0430\u0441\u0442\u044c \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f this, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 ECMAScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u044b, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u043f\u043e\u043c\u043e\u0447\u044c \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/811049\/\"> https:\/\/habr.com\/ru\/articles\/811049\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0442\u0440\u0438 \u0432\u0435\u0449\u0438: \u043a\u0430\u043a \u0433\u043e\u0440\u0438\u0442 \u043e\u0433\u043e\u043d\u044c, \u043a\u0430\u043a \u0442\u0435\u0447\u0435\u0442 \u0432\u043e\u0434\u0430 \u0438 \u0442\u043e \u043a\u0430\u043a \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440\u044b \u043f\u0438\u0448\u0443\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e this.<\/p>\n<p>\u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a, \u0442\u0435\u043c\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0430\u044f \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u0440\u044b \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 this \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439. \u0415\u0441\u0442\u044c \u0438 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0435\u0440\u043d\u043e, \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0447\u0438\u0441\u0442\u043e \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0432\u043d\u0438\u043a\u0430\u043d\u0438\u044f \u0432 \u0442\u043e \u201c\u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435\u201d. \u0410 \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u0442\u0435\u043e\u0440\u0438\u044e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043f\u043e\u0433\u043b\u0443\u0431\u0436\u0435 \u0441 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 ECMAScript, \u0430 \u0443\u0436\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f this \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<h2>\u0422\u0438\u043f Reference Record<\/h2>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>this<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Reference Record.<\/p>\n<p><strong>Reference Record<\/strong> &#8212; \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 ECMAScript (\u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 \u0442\u0438\u043f\u0430\u043c\u0438 \u0432 JavaScript, \u0438\u043d\u0430\u0447\u0435 \u0437\u0430 \u0432\u0430\u043c\u0438 \u043f\u0440\u0438\u0434\u0435\u0442 \u041c\u0443\u0440\u044b\u0447), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u044f\u0437\u044b\u043a\u0430. \u041e\u043d \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f: <strong>Base<\/strong>, <strong>ReferencedName<\/strong>, <strong>Strict <\/strong>\u0438<strong> ThisValue<\/strong>. \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u043d\u0438\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/p>\n<p><strong>Base <\/strong>&#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 JavaScript, \u043b\u0438\u0431\u043e Enviroment Record (\u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0438\u043f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438).<\/p>\n<p><strong>ReferencedName <\/strong>&#8212; String, Symbol \u0438\u043b\u0438 Private Name.<\/p>\n<p><strong>Strict <\/strong>&#8212; Boolean.<\/p>\n<p><strong>ThisValue <\/strong>&#8212; \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 JavaScript.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, Base \u044d\u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 Enviroment Record (\u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435), ReferencedName \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430, Strict \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 strict mode, \u0430 ThisValue \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c super.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u043b\u044f Strict \u0438 ThisValue \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043d\u0430\u043c \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0442\u0438\u043f\u0443? \u0422\u0443\u0442 \u0432\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u043a\u0430\u043a \u0442\u0438\u043f Reference \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <strong>Property Accessor<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 &#8212; <code>obj.name<\/code>, <code>obj[\u2018name\u2019]<\/code> \u0438\u043b\u0438 <code>obj.method()<\/code>. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e this \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0440\u0430\u0437\u0430, \u0447\u0442\u043e this \u0440\u0430\u0432\u043d\u043e \u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438, \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u043f\u0440\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<\/li>\n<li>\n<p>\u0418 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 <strong>Identifier<\/strong>,<strong> <\/strong>\u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<\/ol>\n<p>\u0412\u043e \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 (<code>x + y<\/code>, <code>x ? y : z<\/code>, <code>!x<\/code>) \u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432 (<code>\u201cabc\u201d<\/code>, <code>[1, 2, 3]<\/code> \u0438 \u0442\u0434), \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 person:<\/p>\n<pre><code class=\"javascript\">const person = {   name: \u201cDasha\u201d,   catName: \u201cThomas\u201d, }  person.catName<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0445\u043e\u0434\u044f\u0441\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u0443\u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Property Accessor \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>catName<\/code>, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 Reference Record, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">{   Base: person,   ReferencedName: catName, }<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:<\/p>\n<pre><code class=\"javascript\">const cat = \"Thomas\"<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u043e\u0436\u0435 Reference, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">{   Base: global object,   ReferencedName: cat, }<\/code><\/pre>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443 \u043f\u0440\u043e <strong>global object<\/strong> &#8212; \u044d\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 strict mode \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 <strong>window \u0438\u043b\u0438 undefined<\/strong> (\u0432 strict mode). \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0434\u0430\u043b\u0435\u0435 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u043e <strong>global<\/strong>.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Base \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f ReferencedName.<\/p>\n<h2>This \u0438 \u0442\u0438\u043f Reference<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Reference Record, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 this.<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 &#8212; \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 <strong>\u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 Reference, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f Base<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">const person = {   name: \u201cDasha\u201d,   catName: \u201cThomas\u201d,   getCatName() {     return this.catName;   } }  person.getCatName()<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0442\u0438\u043f Reference, \u0433\u0434\u0435<strong> Base \u0440\u0430\u0432\u043d\u043e person<\/strong>,<strong> <\/strong>\u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 <strong>this \u0440\u0430\u0432\u043d\u043e person<\/strong>.<\/p>\n<pre><code class=\"javascript\">const getCatName = person.getCatName  getCatName()<\/code><\/pre>\n<p>\u0410 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435? \u0412\u044b\u0437\u043e\u0432 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 <code>getCatName<\/code> \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u0438\u043f\u0443 Reference, \u0433\u0434\u0435 <strong>Base \u0431\u0443\u0434\u0435\u0442 global<\/strong>, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 <strong>this \u0440\u0430\u0432\u043d\u043e global<\/strong>.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0414\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u043f\u0440\u043e\u0448\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 (isPropertyReference \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430) \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e this \u0438\u0437 Base.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442\u0435, \u0442.\u043a. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f PropertyReference, \u0433\u0434\u0435 \u0432 Base \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f Enviroment Record, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f global object.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0434\u043e\u0431\u0430\u0432\u0438\u043c ; \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0441\u043a\u043e\u0431\u043e\u043a ;(person.getCatName)(); (false || person.getCatName)(); false || person.getCatName();<\/code><\/pre>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 <code>()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442\u0438\u043f Reference \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 &#8216;Thomas&#8217;.<\/p>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438, \u043d\u043e \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>||<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0442\u0435\u0440\u0435 \u0442\u0438\u043f\u0430 Reference, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 this \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f global. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0441\u0442\u0440\u043e\u0433\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 <code>this.catName<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e this \u0431\u0443\u0434\u0435\u0442 <code>undefined<\/code> \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a <code>undefined.catName<\/code>.<\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043d\u043e \u0431\u0435\u0437 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <code>person.getCatName()<\/code> \u0441 \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u0441 \u0442\u0438\u043f\u043e\u043c Reference, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0435\u0442 &#8216;Thomas&#8217;.<\/p>\n<p>\u042d\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e <strong>\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438<\/strong>, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0430\u0437\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c this.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 this \u0432 \u043a\u043e\u043b\u043b\u0431\u044d\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0433\u0434\u0435 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0431\u044d\u043a. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u043f\u0440\u043e <strong>\u0432\u043d\u0435\u0448\u043d\u0435\u0435 API<\/strong>, \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>addEventListener()<\/code> \u0438\u043b\u0438 <code>setTimeout()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 HTML, \u0433\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0430 \u043d\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, this \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043b\u043b\u0431\u044d\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043a\u043b\u0438\u043a\u0430 \u043d\u0430 <code>document<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u0430\u043c <strong>document<\/strong>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u043d\u0430\u0432\u0435\u0448\u0430\u043d \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"javascript\">document.addEventListener('click', function() {   console.log(this) })<\/code><\/pre>\n<p>\u0410 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 forEach this \u0443\u0436\u0435 \u0440\u0430\u0432\u0435\u043d <strong>global<\/strong>:<\/p>\n<pre><code class=\"javascript\">[1, 2, 3].forEach(function() {   console.log(this) })<\/code><\/pre>\n<h2>\u0421\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<p>\u0421\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f this, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u043d\u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u044e\u0442, \u0430 \u0431\u0435\u0440\u0443\u0442 \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>this \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0430, \u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/strong>. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   getCatName: () => {   return this.catName   } }  person.getCatName()<\/code><\/pre>\n<p>\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043b\u0435\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getCatName<\/code> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 global. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 <code>person.getCatName()<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code>undefined<\/code> \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 strict mode.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e?<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   getCatName: () => {     return this.catName   },   wrapperFoo() {     return this.getCatName()   } }  person.wrapperFoo()<\/code><\/pre>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, this \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>getCatName()<\/code> \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a \u0438 \u0433\u0434\u0435 \u043c\u044b \u0435\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c.<\/p>\n<p>\u041d\u043e, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0447\u0442\u043e this \u0432\u043e\u0437\u044c\u043c\u0435\u0442\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0432\u044b\u0437\u043e\u0432 <code>person.wrapperFoo2()<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u2018Thomas\u2019:<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   getCatName: () => {   return this.catName   },   wrapperFoo() {     return this.getCatName();   },   wrapperFoo2() {     return () => {       return this.catName;     }   } }  person.wrapperFoo2()<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f this \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043d\u0435 \u0435\u0435 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">const person = {   catName: \u201cThomas\u201d,   wrapperFoo() {     return () => {       return this.catName;     }   } }  const foo = person.wrapperFoo()  foo(); \/\/ \u2018Thomas\u2019<\/code><\/pre>\n<p>\u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f \u043f\u0440\u043e \u0442\u0438\u043f Reference \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 this? \u0414\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u0434\u0430\u043d\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043b\u043b\u0431\u044d\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>bind()<\/code>, <code>call()<\/code> \u0438 <code>apply()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 this \u0434\u043b\u044f \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0427\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>bind()<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>call() \u0438 apply()<\/figcaption><\/div>\n<\/figure>\n<h2>\u041c\u0435\u0442\u043e\u0434\u044b bind, call, apply<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c this \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u041d\u043e \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043e\u0441\u043e\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <code>bind()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043e\u0441\u043e\u0431\u043e\u0439 <strong>bound function (\u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f)<\/strong>. \u0413\u043b\u0430\u0432\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0432 \u043f\u043e\u043b\u0435 <strong>BoundThis<\/strong>.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"javascript\">const cat = {   name: \u2018Thomas\u2019,   getOwnerName() {   return this.ownerName   } }  const owner = {   ownerName: \u2018Dasha\u2019, }  const boundGetOwnerName = cat.getOwnerName.bind(owner)  boundGetOwnerName()<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 owner \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>bind()<\/code> \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043e\u043d\u0430 \u0432\u044b\u0437\u0432\u0430\u043d\u0430. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>call()<\/code> \u0438 <code>apply()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 <code>bind()<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this:<\/p>\n<pre><code class=\"javascript\">const anotherOwner = {   ownerName: \u201cIlia\u201d, }  boundGetOwnerName.apply(anotherOwner) boundGetOwnerName.call(anotherOwner)<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043a bound function, \u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c this \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>call() \u0438 apply()<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0442\u0438\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0445\u043e\u0437\u044f\u0438\u043d\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u0435\u0433\u043e \u0441\u0432\u044f\u0437\u0430\u043b\u0438. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>bind()<\/code>, \u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>\u0425\u043e\u0442\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 &#8212; \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 this \u0434\u043b\u044f <code><\/code><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-374929","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=374929"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374929\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}