{"id":323214,"date":"2021-05-16T21:00:31","date_gmt":"2021-05-16T21:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323214"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323214","title":{"rendered":"\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 Javascript: \u0432\u0441\u0451, \u0447\u0442\u043e \u0432\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 10 \u043b\u0435\u0442"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">JavaScript \u043f\u0440\u043e\u0448\u0435\u043b \u0434\u043e\u043b\u0433\u0438\u0439 \u043f\u0443\u0442\u044c \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440, \u043a\u0430\u043a \u044f \u0437\u043d\u0430\u043b \u0435\u0433\u043e \u043a\u0430\u043a \u0431\u0443\u043a\u0432\u0443 \u00abD\u00bb \u0432 DHTML. \u0414\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u0442\u043e, \u043a\u0430\u043a \u044f, \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u043b\u043e\u0432 \u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u044d\u0442\u0443 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445.<\/p>\n<p>  <b>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/b><\/p>\n<ul>\n<li>Array functions<\/li>\n<li>const\/let<\/li>\n<li>Nullish coalescing ?? and Optional chaining?.. operators<\/li>\n<li>Async\/Await<\/li>\n<li>Arrow functions ()=&gt;{}<\/li>\n<li>for&#8230;of<\/li>\n<li>for await&#8230;of<\/li>\n<li>Classes<\/li>\n<li>get\/set<\/li>\n<li>function default parameters<\/li>\n<li>function named parameters<\/li>\n<li>function rest\u2026 parameter<\/li>\n<li>Destructuring<\/li>\n<li>Shorthand functions aka Methods<\/li>\n<li>Promise.all<\/li>\n<li>Template literals<\/li>\n<li>Proxy<\/li>\n<li>Module import\/export<\/li>\n<li>\u0427\u0438\u0442\u0430\u0442\u044c \u0435\u0449\u0451<\/li>\n<\/ul>\n<p>  <i>(\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0439\u0442\u0435 \u0432 \u043b\u0438\u0447\u043a\u0443)<\/i><br \/>  <a name=\"habracut\"><\/a><\/p>\n<h3>Array functions<\/h3>\n<p>  \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0438\u043c\u0438 \u043d\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 underscore \u0438\u043b\u0438 lodash.<\/p>\n<p>  Array.every()<br \/>  Array.filter()<br \/>  Array.find()<br \/>  Array.findIndex()<br \/>  Array.forEach()<br \/>  Array.from()<br \/>  Array.includes()<br \/>  Array.isArray()<br \/>  Array.lastIndexOf()<br \/>  Array.map()<br \/>  Array.reduce()<br \/>  Array.reduceRight()<br \/>  Array.some()<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Array#instance_methods\" rel=\"nofollow noopener noreferrer\">Array docs<\/a><\/p>\n<h3>const\/let<\/h3>\n<p>  \u042d\u0442\u0438 \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u043b\u043e\u043a\u0430 (\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438). \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>const<\/code> \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u0430. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>let<\/code>, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>  <a href=\"https:\/\/www.w3schools.com\/js\/js_let.asp\" rel=\"nofollow noopener noreferrer\">Let documentation<\/a><\/p>\n<h3>?? \u0438 ?.<\/h3>\n<p>  <code>??<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0438\u043b\u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<code> !!<\/code>.<\/p>\n<p>  <code>?.<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0427\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u0430\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Operators\/Optional_chaining\" rel=\"nofollow noopener noreferrer\">Optional chaining documentation<\/a><\/p>\n<pre><code class=\"javascript\">let a, b=1 let result = a ?? b print(result)  result = (a !== null &amp;&amp; a !== undefined) ? a : b; print(result)        print({x:1}?.a?.b ?? &quot;not found&quot;)       <\/code><\/pre>\n<h3>Async\/Await<\/h3>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 async\/await \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0430\u0441\u0442\u0438 \u0432\u0430\u0441 \u043e\u0442 \u0430\u0434\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>await<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u0442.\u0435. \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>await fetchUserName()<\/code> \u043d\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u043e\u043a\u0430 fetchUserName() \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>await<\/code>, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a async, \u0442.\u0435. <code>async function fn () {await fetchUserName ()}.<\/code><\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/JavaScript\/Asynchronous\/Async_await\" rel=\"nofollow noopener noreferrer\">Async\/Await docs.<\/a><\/p>\n<pre><code class=\"javascript\">function fetchUserName() {   return new Promise(resolve =&gt; setTimeout(resolve, 500)) }        async function withAsync() {   print(&quot;withAsync: fetching...&quot;)   await fetchUserName()   print(&quot;withAsync: done&quot;) } await withAsync()        function withoutAsync() {   print(&quot;withoutAsync: fetching...&quot;)   fetchUserName().then(()=&gt;print(&quot;withoutAsync done&quot;)) } withoutAsync()     <\/code><\/pre>\n<h3>Arrow functions ()=&gt;{}<\/h3>\n<p>  \u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443. \u0415\u0441\u0442\u044c \u0442\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u0438\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u0434\u0438\u043a\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u0435:<br \/>  \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430, \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>  \u0424\u043e\u0440\u043c\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0444\u043e\u0440\u043c\u0430 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>return<\/code>; \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0431\u0435\u0437\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0447\u043d\u044b\u0439.<\/p>\n<pre><code class=\"javascript\">1 const fn = a =&gt; a*2<\/code><\/pre>\n<p>  <i>\u041e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442. \u041e\u0434\u043d\u0430 \u043b\u0438\u043d\u0438\u044f.<\/i><\/p>\n<p>  \u041c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>return<\/code>, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u043c\u0435\u0440\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c. \u0414\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043a\u0440\u0443\u0433\u043b\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438.<\/p>\n<pre><code class=\"javascript\">const fn = (a,b) =&gt; {   console.log(a,b)   return a*b }<\/code><\/pre>\n<p>  <i>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a.<\/i><\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Functions\/Arrow_functions#syntax\" rel=\"nofollow noopener noreferrer\">Arrow function docs<\/a><\/p>\n<h3>for&#8230;of<\/h3>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e <code>for...in<\/code>, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c <code>hasOwnProperty<\/code>. \u0412\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0446\u0438\u043a\u043b\u0430 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0435\u0442 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>Object.entries ({})<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/for...of\" rel=\"nofollow noopener noreferrer\">for&#8230;of docs<\/a><\/p>\n<pre><code class=\"javascript\">const x = {a: 1, b: 2} for (const [key, value] of Object.entries(x)) {   print(`${key}=${value}`) }<\/code><\/pre>\n<h3>for await&#8230;of<\/h3>\n<p>  \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u200b\u200b\u0432 2018 \u0433\u043e\u0434\u0443. \u041a\u0430\u043a \u0438 <code>Promise.all<\/code>, \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b 3 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e. \u0426\u0438\u043a\u043b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430 \u0440\u0430\u0437 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443; \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0430\u043c\u044b\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/for-await...of\" rel=\"nofollow noopener noreferrer\">for await&#8230;of docs<\/a><\/p>\n<pre><code class=\"javascript\">const delay = (n) =&gt; {   return new Promise((resolve) =&gt; {     setTimeout(()=&gt;{       print(&quot;resolve &quot;+n)       resolve(n)     }, n)   }) }  const delays = [   delay(150),   delay(50),   delay(25) ]  for await (const ret of delays) {   print(&quot;for loop await &quot;+ret) }<\/code><\/pre>\n<h3>Classes<\/h3>\n<p>  \u0412 2015 \u0433\u043e\u0434\u0443 ES6 \u043f\u0435\u0440\u0435\u043d\u0435\u0441 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 Javascript. \u041a\u043b\u0430\u0441\u0441\u044b Javascript \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0438 \u043b\u044e\u0431\u0438\u0442\u0435. \u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430, \u0433\u0435\u0442\u0442\u0435\u0440\u044b \u0438 \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0442.\u0434.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Classes#super_class_calls_with_super\" rel=\"nofollow noopener noreferrer\">Class documentation<\/a><\/p>\n<pre><code class=\"javascript\">class A {   constructor(name) {     this.name = name   }   myProp = &quot;myProp&quot;   static foo() {     print(&quot;Static method says foo&quot;)   } } class B extends A {   constructor(name, age) {     super(name)     this.age = age   }   toString() {     return `${this.name} ${this.age}`   } } A.foo() const b = new B(&quot;Catch&quot;, 22) print(b) print(b.myProp)<\/code><\/pre>\n<h3>get\/set<\/h3>\n<p>  Get \u0438 set \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>person.age = 16; person.age&gt; 18<\/code>. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e. \u0418 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, \u0442\u0430\u043a \u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Functions#getter_and_setter_functions\" rel=\"nofollow noopener noreferrer\">get\/set documentation<\/a><\/p>\n<p>  <b>Classes with getters and setters<\/b>  <\/p>\n<pre><code class=\"javascript\">class A {   constructor() {     this._firstName = &quot;Jane&quot;     this._lastName = &quot;Smith&quot;   }   get fullName() {     return `${this._firstName} ${this._lastName}`   }   set firstName(v) {     this._firstName = v   } } const a = new A() print(a.fullName) a.firstName = &quot;John&quot; print(a.fullName)<\/code><\/pre>\n<p>  <b>Objects with getters and setters<\/b>  <\/p>\n<pre><code class=\"javascript\">const x = {   get now() { return new Date() } } print(x.now)<\/code><\/pre>\n<h3>function default parameters<\/h3>\n<p>  \u0423\u0440\u0430! \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Functions\/Default_parameters\" rel=\"nofollow noopener noreferrer\">Default parameter docs<\/a><\/p>\n<pre><code class=\"javascript\">function greet(msg=&quot;Hello world&quot;) {   print(msg) } greet() greet(&quot;hi&quot;)<\/code><\/pre>\n<h3>function named parameters<\/h3>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0433\u0438\u0438 \u0440\u0430\u0437\u0440\u0443\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Operators\/Destructuring_assignment#unpacking_fields_from_objects_passed_as_a_function_parameter\" rel=\"nofollow noopener noreferrer\">Named parameter docs<\/a><\/p>\n<pre><code class=\"javascript\">function greet({name = &quot;Jane&quot;, age = 42} = {}){   print(name + &quot; &quot; +age) } greet() greet({name: &quot;John&quot;, age: 21})<\/code><\/pre>\n<h3>function rest\u2026 parameter<\/h3>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0441\u0431\u0440\u043e\u0441\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e <code>arguments<\/code>.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Functions\/rest_parameters\" rel=\"nofollow noopener noreferrer\">Rest parameter docs<\/a><\/p>\n<pre><code class=\"javascript\">function greet(msg1, ...msgs) {   print(msg1)   msgs.forEach(s =&gt; print(s)) } greet(&quot;hi&quot;, &quot;hello&quot;, &quot;world&quot;)<\/code><\/pre>\n<h3>Object.assign and spread operator<\/h3>\n<p>  <code>Object.assign(target, source)<\/code> \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0434\u0432\u0430 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043e\u0434\u0438\u043d. \u041e\u043d \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \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.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f <code>...<\/code> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: <code>{... obj1, ... obj2}<\/code>, \u0445\u043e\u0442\u044f \u0438\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e <code>spread<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0442\u0442\u0435\u0440\u044b \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u044b\u043c, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <code>Object.assign<\/code>. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Operators\/Spread_syntax\" rel=\"nofollow noopener noreferrer\">Spread syntax docs<\/a><\/p>\n<pre><code class=\"javascript\">const source = {x: 1, y: 4} const target = Object.assign({}, source) print(JSON.stringify(target))  const spread = {a: 1, b: 2, ...source} print(JSON.stringify(spread))  const ary1 = [1] const ary = [...ary1, [2,3]] print(ary)       <\/code><\/pre>\n<h3>Destructuring<\/h3>\n<p>  \u0414\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. \u042d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439\u2026 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044f \u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c, \u043d\u043e \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c.<\/p>\n<p>  <a href=\"https:\/\/exploringjs.com\/es6\/ch_destructuring.html\" rel=\"nofollow noopener noreferrer\">Destructuring docs<\/a> \u0438 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Operators\/Destructuring_assignment\" rel=\"nofollow noopener noreferrer\">MDN docs<\/a><\/p>\n<pre><code class=\"javascript\">function f() {   return [1, 2]; } let [a, b] = f() print(&quot;a=&quot;+a + &quot; b=&quot; + b)  const obj = {state: {id: 1, is_verified: false}} const {id, is_verified: verified} = obj.state print(&quot;id = &quot; + id) print(&quot;verified = &quot; + verified)  for (const [key, value] of Object.entries({a: 1, b: 2, c: 3})) {   print(key + &quot; is &quot; + value); }       <\/code><\/pre>\n<h3>Shorthand functions aka Methods<\/h3>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e function.<\/p>\n<p>  \u0414\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (fn1, fn2) \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Functions\/Method_definitions\" rel=\"nofollow noopener noreferrer\">Method guide<\/a><\/p>\n<pre><code class=\"javascript\">const x = {   type: &quot;x&quot;,   shorthand() {     print(&quot;shorthand &quot;+this.type)   },   long: function() {     print(&quot;long &quot;+this.type)   } } x.shorthand() x.long() <\/code><\/pre>\n<h3>Promise.all<\/h3>\n<p>  \u042f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u043b promises, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e async\/await \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0438 Promise.all \u2014 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Promise\/all\" rel=\"nofollow noopener noreferrer\">Promise.all documentation<\/a><\/p>\n<pre><code class=\"javascript\">const delay = (n) =&gt; {   return new Promise((resolve) =&gt; {     setTimeout(()=&gt; resolve(n), n)   }) } async function main() {   const delays = [100, 200, 300].map(n =&gt; delay(n))   print(&quot;waiting\u2026&quot;)   const res = await Promise.all(delays)   print(&quot;done. result is &quot; + res) } main()       <\/code><\/pre>\n<h3>Template literals<\/h3>\n<p>  \u042d\u0442\u043e\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043a\u0430\u043a template strings, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e \u0441\u0442\u0440\u043e\u043a \u0438 \u00ab\u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438\u00bb (multi-line strings).<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Template_literals\" rel=\"nofollow noopener noreferrer\">Template literal docs<\/a><\/p>\n<pre><code class=\"javascript\">let x = `multi       line string` print(x)  x = `1+1=${1+1}` print(x)<\/code><\/pre>\n<h3>Proxy<\/h3>\n<p>  \u041f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b get\/set \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f DOM \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/github.com\/justjavac\/proxy-www\" rel=\"nofollow noopener noreferrer\">\u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 API<\/a>, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0441\u0438 www \u043d\u0438\u0436\u0435.<\/p>\n<p>  <a href=\"https:\/\/twitter.com\/RReverser\/status\/1138788910975397888?s=20\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/800\/40f\/e50\/80040fe50519a85a50a8324b396923fc.png\" alt=\"image\"><\/a><\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Proxy\" rel=\"nofollow noopener noreferrer\">Proxy docs<\/a><\/p>\n<pre><code class=\"javascript\">let _nums = [1,2,3] let nums = new Proxy(_nums, {   set(target, key, value) {     target[key] = value     print(&quot;set called with &quot; + key + &quot;=&quot; + value)     print(&quot;update DOM&quot;)     return true   } }) nums.push(4) print(&quot;nums: &quot; + nums) print(&quot;_nums: &quot; + _nums)<\/code><\/pre>\n<h3>Module import\/export<\/h3>\n<p>  \u041c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c greet.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 index.html. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 HTML. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \/ \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 js, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/export\" rel=\"nofollow noopener noreferrer\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0443<\/a>.<\/p>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Statements\/import\" rel=\"nofollow noopener noreferrer\">Import docs<\/a><\/p>\n<pre><code class=\"javascript\">function greet(msg) {   console.log(&quot;greet:&quot;, msg) } export default greet<\/code><\/pre>\n<p>  <i>\u0424\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u00abgreet.js\u00bb \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 &quot;\/js&quot;.<\/i><\/p>\n<pre><code class=\"javascript\">&lt;script type=&quot;module&quot;&gt;   import greet from &quot;\/js\/greet.js&quot;   greet(&quot;hi&quot;) &lt;\/script&gt;<\/code><\/pre>\n<p>  <i>index.html<\/i><\/p>\n<h3>\u0427\u0438\u0442\u0430\u0442\u044c \u0435\u0449\u0451<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e\u0431\u043e \u0432\u0441\u0435\u043c, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u044e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438. \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u044d\u0442\u0438\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u043c\u0430\u043c\u0438.<\/p>\n<p>  <b>References<\/b>  <\/p>\n<ul>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Map\" rel=\"nofollow noopener noreferrer\">Map<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Set\" rel=\"nofollow noopener noreferrer\">Set<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Generator\" rel=\"nofollow noopener noreferrer\">Generator<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Strict_mode\" rel=\"nofollow noopener noreferrer\">Strict mode<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Array#instance_methods\" rel=\"nofollow noopener noreferrer\">Array methods<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Object#static_methods\" rel=\"nofollow noopener noreferrer\">Object static methods<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Reflect\" rel=\"nofollow noopener noreferrer\">Reflect<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/URL\" rel=\"nofollow noopener noreferrer\">URL<\/a><\/li>\n<\/ul>\n<p>  <b>Guides<\/b>  <\/p>\n<ul>\n<li><a href=\"https:\/\/javascript.info\/\" rel=\"nofollow noopener noreferrer\">Javascript.info<\/a><\/li>\n<li><a href=\"https:\/\/exploringjs.com\/es6\/\" rel=\"nofollow noopener noreferrer\">Exploring ES6<\/a><\/li>\n<li><a href=\"https:\/\/www.w3schools.com\/js\/js_history.asp\" rel=\"nofollow noopener noreferrer\">Javascript History<\/a><\/li>\n<li><a href=\"https:\/\/flaviocopes.com\/javascript-async-defer\/\" rel=\"nofollow noopener noreferrer\">Non-blocking JS loading with async\/defer<\/a><\/li>\n<\/ul>\n<\/div>\n<p> \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\/post\/557634\/\"> https:\/\/habr.com\/ru\/post\/557634\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">JavaScript \u043f\u0440\u043e\u0448\u0435\u043b \u0434\u043e\u043b\u0433\u0438\u0439 \u043f\u0443\u0442\u044c \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440, \u043a\u0430\u043a \u044f \u0437\u043d\u0430\u043b \u0435\u0433\u043e \u043a\u0430\u043a \u0431\u0443\u043a\u0432\u0443 \u00abD\u00bb \u0432 DHTML. \u0414\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u0442\u043e, \u043a\u0430\u043a \u044f, \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u043b\u043e\u0432 \u0438\u043b\u0438 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u044d\u0442\u0443 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445.<\/p>\n<p>  <b>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/b><\/p>\n<ul>\n<li>Array functions<\/li>\n<li>const\/let<\/li>\n<li>Nullish coalescing ?? and Optional chaining?.. operators<\/li>\n<li>Async\/Await<\/li>\n<li>Arrow functions ()=&gt;{}<\/li>\n<li>for&#8230;of<\/li>\n<li>for await&#8230;of<\/li>\n<li>Classes<\/li>\n<li>get\/set<\/li>\n<li>function default parameters<\/li>\n<li>function named parameters<\/li>\n<li>function rest\u2026 parameter<\/li>\n<li>Destructuring<\/li>\n<li>Shorthand functions aka Methods<\/li>\n<li>Promise.all<\/li>\n<li>Template literals<\/li>\n<li>Proxy<\/li>\n<li>Module import\/export<\/li>\n<li>\u0427\u0438\u0442\u0430\u0442\u044c \u0435\u0449\u0451<\/li>\n<\/ul>\n<p>  <i>(\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0439\u0442\u0435 \u0432 \u043b\u0438\u0447\u043a\u0443)<\/i>  <\/p>\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-323214","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323214","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=323214"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323214\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}