{"id":279896,"date":"2016-10-25T13:45:02","date_gmt":"2016-10-25T09:45:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=279896"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=279896","title":{"rendered":"\u041e\u0431\u0437\u043e\u0440 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 ES6"},"content":{"rendered":"<p>JavaScript \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b. \u0412\u043e\u0442 12 \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!<\/p>\n<p>  <\/p>\n<h1 id=\"istoriya\">\u0418\u0441\u0442\u043e\u0440\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u044f\u0437\u044b\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f ECMAScript 6. \u0418\u043b\u0438 ES6 \u0438\u043b\u0438 ES2015+.<\/p>\n<p>  <\/p>\n<p>\u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 1995, JavaScript \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442. ECMAScript \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 1997, \u0435\u0433\u043e \u0446\u0435\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 JavaScript \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u0440\u0443\u0441\u043b\u043e. \u0412\u044b\u0445\u043e\u0434\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u2013 ES3, ES5, ES6 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/504\/a78\/cba\/504a78cba9324062bb3d66d6af2e0588.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 ES3, ES5 \u0438 ES6 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0434\u043b\u0438\u043d\u043e\u0439 \u0432 10 \u0438 6 \u043b\u0435\u0442. \u041d\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u2013 \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0434. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u0437\u0430 \u0440\u0430\u0437, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441 ES6.<a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<h1 id=\"browsers-support\">Browsers Support<\/h1>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0438 \u0441\u0440\u0435\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 ES6!<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/581\/ded\/906\/581ded906b3340ae91209ab6f200999e.png\"\/><\/p>\n<p>  <\/p>\n<p>Chrome, MS Edge, Firefox, Safari, Node \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043c\u0435\u044e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 JavaScript ES6. \u0422\u0430\u043a \u0447\u0442\u043e, \u0432\u0441\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u043e\u0431\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>  <\/p>\n<h1 id=\"glavnye-vozmozhnosti-es6\">\u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 ES6<\/h1>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<h2 id=\"block-scope-variables\">Block scope variables<\/h2>\n<p>  <\/p>\n<p>\u0412 ES6 \u043c\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043e\u0442\u00a0<code>var<\/code>\u043a\u00a0<code>let<\/code>\/<code>const<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u00a0<code>var<\/code>?<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u00a0<code>var<\/code> \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &quot;\u043f\u0440\u043e\u0442\u0435\u043a\u0430\u0435\u0442&quot; \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0446\u0438\u043a\u043b\u044b <code>for<\/code> \u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 <code>if<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>ES5 var x = 'outer'; function test(inner) {   if (inner) {     var x = 'inner'; \/\/ scope whole function     return x;   }   return x; \/\/ gets redefined on line 4 }  test(false); \/\/ undefined  test(true); \/\/ inner<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0435\u00a0<code>test(false)<\/code>\u00a0\u043c\u043e\u0436\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u00a0<code>outer<\/code>, \u043d\u043e \u043d\u0435\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u00a0<code>undefined<\/code>. \u041f\u043e\u0447\u0435\u043c\u0443?<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0431\u043b\u043e\u043a <code>if<\/code> \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043d\u0430 4\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u00a0<code>var x<\/code>\u00a0\u043a\u0430\u043a\u00a0<code>undefined<\/code>.<\/p>\n<p>  <\/p>\n<p>ES6 \u0441\u043f\u0435\u0448\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c:<\/p>\n<p>  <\/p>\n<pre><code>ES6 let x = 'outer'; function test(inner) {   if (inner) {     let x = 'inner';     return x;   }   return x; \/\/ gets result from line 1 as expected }  test(false); \/\/ outer test(true); \/\/ inner<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u0432\u00a0<code>var<\/code>\u00a0\u043d\u0430\u00a0<code>let<\/code>\u00a0\u043c\u044b \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0431\u043b\u043e\u043a <code>if<\/code> \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f\u00a0<code>x<\/code>\u00a0\u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p><strong>IIFE (immediately invoked function expression)<\/strong><\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code>ES5 {   var private = 1; }  console.log(private); \/\/ 1<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435,\u00a0<code>private<\/code>\u00a0\u043f\u0440\u043e\u0442\u0435\u043a\u0430\u0435\u0442 \u043d\u0430\u0440\u0443\u0436\u0443. \u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0IIFE\u00a0(immediately-invoked function expression):<\/p>\n<p>  <\/p>\n<pre><code>ES5 (function(){   var private2 = 1; })();  console.log(private2); \/\/ Uncaught ReferenceError<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 jQuery\/lodash \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c IIFE \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432 \u0447\u0438\u0441\u0442\u043e\u0442\u0435. \u0410 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0432\u0440\u043e\u0434\u0435 <code>_<\/code>,\u00a0<code>$<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>jQuery<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412 ES6 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c IIFE, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438 \u0438 <code>let<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>ES6 {   let private3 = 1; }  console.log(private3); \/\/ Uncaught ReferenceError<\/code><\/pre>\n<p>  <\/p>\n<p><strong>Const<\/strong><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<code>const<\/code> \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u043e\u0433: <\/p>\n<p>  <\/p>\n<ul>\n<li>\u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435\u00a0<code>var<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u00a0<code>let<\/code>\u00a0\u0438\u00a0<code>const<\/code>.<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u00a0<code>const<\/code>\u00a0\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043e\u0432; \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u00a0<code>var<\/code>.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u00a0<code>let<\/code>\u00a0\u0432\u043c\u0435\u0441\u0442\u043e\u00a0<code>const<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"template-literals\">Template Literals<\/h2>\n<p>  <\/p>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code>ES5 var first = 'Adrian'; var last = 'Mejia'; console.log('Your name is ' + first + ' ' + last + '.');<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u044d\u043a\u0442\u0438\u043a\u0430 (<code>) \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u00a0<\/code>${}` \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code>ES6 const first = 'Adrian'; const last = 'Mejia'; console.log(`Your name is ${first} ${last}.`);<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"multi-line-strings\">Multi-line strings<\/h2>\n<p>  <\/p>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 +\u00a0<code>\\n<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>ES5 var template = '&lt;li *ngFor=&quot;let todo of todos&quot; [ngClass]=&quot;{completed: todo.isDone}&quot; &gt;\\n' + '  &lt;div class=&quot;view&quot;&gt;\\n' + '    &lt;input class=&quot;toggle&quot; type=&quot;checkbox&quot; [checked]=&quot;todo.isDone&quot;&gt;\\n' + '    &lt;label&gt;&lt;\/label&gt;\\n' + '    &lt;button class=&quot;destroy&quot;&gt;&lt;\/button&gt;\\n' + '  &lt;\/div&gt;\\n' + '  &lt;input class=&quot;edit&quot; value=&quot;&quot;&gt;\\n' + '&lt;\/li&gt;'; console.log(template);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 ES6 \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u044d\u043a\u0442\u0438\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code>ES6 const template = `&lt;li *ngFor=&quot;let todo of todos&quot; [ngClass]=&quot;{completed: todo.isDone}&quot; &gt;   &lt;div class=&quot;view&quot;&gt;     &lt;input class=&quot;toggle&quot; type=&quot;checkbox&quot; [checked]=&quot;todo.isDone&quot;&gt;     &lt;label&gt;&lt;\/label&gt;     &lt;button class=&quot;destroy&quot;&gt;&lt;\/button&gt;   &lt;\/div&gt;   &lt;input class=&quot;edit&quot; value=&quot;&quot;&gt; &lt;\/li&gt;`; console.log(template);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0430 \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<p>  <\/p>\n<h2 id=\"destructuring-assignment\">Destructuring Assignment<\/h2>\n<p>  <\/p>\n<p>ES6 desctructing \u2013 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<p>  <\/p>\n<p><strong>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/strong><\/p>\n<p>  <\/p>\n<pre><code>ES5 var array = [1, 2, 3, 4];  var first = array[0]; var third = array[2];  console.log(first, third); \/\/ 1 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code>ES6 const array = [1, 2, 3, 4];  const [first, ,third] = array;  console.log(first, third); \/\/ 1 3<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041e\u0431\u043c\u0435\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/strong><\/p>\n<p>  <\/p>\n<pre><code>ES5 var a = 1; var b = 2;  var tmp = a; a = b; b = tmp;  console.log(a, b); \/\/ 2 1<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code>ES6 let a = 1; let b = 2;  [a, b] = [b, a];  console.log(a, b); \/\/ 2 1<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0414\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/strong><\/p>\n<p>  <\/p>\n<pre><code>ES5 function margin() {   var left=1, right=2, top=3, bottom=4;   return { left: left, right: right, top: top, bottom: bottom }; }  var data = margin(); var left = data.left; var bottom = data.bottom;  console.log(left, bottom); \/\/ 1 4<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0435 3 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<p>  <\/p>\n<pre><code>return [left, right, top, bottom];<\/code><\/pre>\n<p>  <\/p>\n<p>\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0442\u044c \u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<pre><code>var left = data[0]; var bottom = data[3];<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 ES6 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0441\u0442\u0440\u043e\u043a\u0430 6):<\/p>\n<p>  <\/p>\n<pre><code>ES6 function margin() {   const left=1, right=2, top=3, bottom=4;   return { left, right, top, bottom }; }  const { left, bottom } = margin();  console.log(left, bottom); \/\/ 1 4<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u0417\u0430\u043c\u0435\u0442\u043a\u0430:<\/em>\u00a0\u0412 \u0441\u0442\u0440\u043e\u043a\u0435 3 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 ES6. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c <code>{ left: left }<\/code>\u00a0\u0434\u043e \u00a0<code>{ left }<\/code>. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 ES5. \u041a\u0440\u0443\u0442\u043e \u0436\u0435?<\/p>\n<p>  <\/p>\n<p><strong>\u0414\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/strong><\/p>\n<p>  <\/p>\n<pre><code>ES5 var user = {firstName: 'Adrian', lastName: 'Mejia'};  function getFullName(user) {   var firstName = user.firstName;   var lastName = user.lastName;    return firstName + ' ' + lastName; }  console.log(getFullName(user)); \/\/ Adrian Mejia<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 (\u043d\u043e \u043a\u043e\u0440\u043e\u0447\u0435):<\/p>\n<p>  <\/p>\n<pre><code>ES6 const user = {firstName: 'Adrian', lastName: 'Mejia'};  function getFullName({ firstName, lastName }) {   return `${firstName} ${lastName}`; }  console.log(getFullName(user)); \/\/ Adrian Mejia<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0413\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>  <\/p>\n<pre><code>ES5 function settings() {   return { display: { color: 'red' }, keyboard: { layout: 'querty'} }; }  var tmp = settings(); var displayColor = tmp.display.color; var keyboardLayout = tmp.keyboard.layout;  console.log(displayColor, keyboardLayout); \/\/ red querty<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 (\u043d\u043e \u043a\u043e\u0440\u043e\u0447\u0435):<\/p>\n<p>  <\/p>\n<pre><code>ES6 function settings() {   return { display: { color: 'red' }, keyboard: { layout: 'querty'} }; }  const { display: { color: displayColor }, keyboard: { layout: keyboardLayout }} = settings();  console.log(displayColor, keyboardLayout); \/\/ red querty<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (object destructing).<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c \u043a \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u0441\u0442\u0438\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0432\u0435\u0442\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u044b \u2013 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f.<\/li>\n<li>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"klassy-i-obekty\">\u041a\u043b\u0430\u0441\u0441\u044b \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/h2>\n<p>  <\/p>\n<p>\u0412 ECMAScript 6 \u043c\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043e\u0442 \u201c\u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432\u201d \u043a \u201c\u043a\u043b\u0430\u0441\u0441\u0430\u043c\u201d .<\/p>\n<p>  <\/p>\n<blockquote><p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 JavaScript \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c. \u0412\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 JavaScript \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0430.<\/p><\/blockquote>\n<p>\u0412 ES5 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u043b\u043e\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432. \u041e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code>ES5 var Animal = (function () {   function MyConstructor(name) {     this.name = name;   }   MyConstructor.prototype.speak = function speak() {     console.log(this.name + ' makes a noise.');   };   return MyConstructor; })();  var animal = new Animal('animal'); animal.speak(); \/\/ animal makes a noise.<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 ES6 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440. \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432\u00a0<code>class<\/code>\u00a0\u0438\u00a0<code>constru\u0441tor<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043a\u0430\u043a \u0447\u0435\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u044b:\u00a0<code>constru\u0441tor.prototype.speak = function ()<\/code>\u00a0vs\u00a0<code>speak()<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>ES6 class Animal {   constructor(name) {     this.name = name;   }   speak() {     console.log(this.name + ' makes a noise.');   } }  const animal = new Animal('animal'); animal.speak(); \/\/ animal makes a noise.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0430 \u0441\u0442\u0438\u043b\u044f (ES5\/6) \u0434\u0430\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0432\u0435\u0442\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0412\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u00a0<code>class<\/code>\u00a0\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0439\u0442\u0435\u00a0<code>prototype<\/code> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435 \u0438 \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0433\u0447\u0435 \u043f\u043e\u043d\u044f\u0442\u044c.<\/li>\n<li>\u0418\u0437\u0431\u0435\u0433\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u0423 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"nasledovanie\">\u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>Animal<\/code>. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>Lion<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412 ES5 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043d\u044b\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>  <\/p>\n<pre><code>ES5 var Lion = (function () {   function MyConstructor(name){     Animal.call(this, name);   }    \/\/ prototypal inheritance   MyConstructor.prototype = Object.create(Animal.prototype);   MyConstructor.prototype.constructor = Animal;    MyConstructor.prototype.speak = function speak() {     Animal.prototype.speak.call(this);     console.log(this.name + ' roars ');   };   return MyConstructor; })();  var lion = new Lion('Simba'); lion.speak(); \/\/ Simba makes a noise. \/\/ Simba roars.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u043d\u043e \u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 3, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440<code>Animal<\/code>\u00a0\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.<\/li>\n<li>\u0421\u0442\u0440\u043e\u043a\u0438 7-8, \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f <code>Lion<\/code>\u00a0\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u043c\u00a0\u043a\u043b\u0430\u0441\u0441\u0430 <code>Animal<\/code>.<\/li>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 11, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u00a0<code>speak<\/code>\u00a0\u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<code>Animal<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 ES6 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430\u00a0<code>extends<\/code>\u00a0\u0438\u00a0<code>super<\/code>.<\/p>\n<p>  <\/p>\n<pre><code>ES6 class Lion extends Animal {   speak() {     super.speak();     console.log(this.name + ' roars ');   } }  const lion = new Lion('Simba'); lion.speak(); \/\/ Simba makes a noise. \/\/ Simba roars.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u043e\u0434 \u043d\u0430 ES6 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 ES5. \u0418 \u043e\u043d\u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435! Win!<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0432\u0435\u0442:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u2013\u00a0<code>extends<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"nativnye-promisy\">\u041d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0438\u0441\u044b<\/h2>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043e\u0442 callback hell \u043a \u043f\u0440\u043e\u043c\u0438\u0441\u0430\u043c (promises) <\/p>\n<p>  <\/p>\n<pre><code>ES5 function printAfterTimeout(string, timeout, done){   setTimeout(function(){     done(string);   }, timeout); }  printAfterTimeout('Hello ', 2e3, function(result){   console.log(result);    \/\/ nested callback   printAfterTimeout(result + 'Reader', 2e3, function(result){     console.log(result);   }); });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 callback \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u0434\u0432\u0430\u0436\u0434\u044b, \u043e\u0434\u043d\u0443 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u0439. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <code>printAfterTimeout<\/code> \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0432 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0440\u0435\u0442\u0438\u0439 \u0438\u043b\u0438 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u043a\u043e\u043b\u043b\u0431\u0435\u043a. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u0440\u043e\u043c\u0438\u0441\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code>ES6 function printAfterTimeout(string, timeout){   return new Promise((resolve, reject) =&gt; {     setTimeout(function(){       resolve(string);     }, timeout);   }); }  printAfterTimeout('Hello ', 2e3).then((result) =&gt; {   console.log(result);   return printAfterTimeout(result + 'Reader', 2e3);  }).then((result) =&gt; {   console.log(result); });<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>then<\/code> \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<h2 id=\"strelochnye-funkcii\">\u0421\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<p>  <\/p>\n<p>\u0412 ES5 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435 \u0438\u0441\u0447\u0435\u0437\u043b\u0438, \u043d\u043e \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u2013 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 ES5 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u00a0<code>this<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>ES5 var _this = this; \/\/ need to hold a reference  $('.btn').click(function(event){   _this.sendData(); \/\/ reference outer this });  $('.input').on('change',function(event){   this.sendData(); \/\/ reference outer this }.bind(this)); \/\/ bind to outer this<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 <code>this<\/code> \u0447\u0442\u043e\u0431\u044b \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>bind<\/code>. \u0412 ES6 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e!<\/p>\n<p>  <\/p>\n<pre><code>ES6 \/\/ this will reference the outer one $('.btn').click((event) =&gt;  this.sendData());  \/\/ implicit returns const ids = [291, 288, 984]; const messages = ids.map(value =&gt; `ID is ${value}`);<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"forof\">For\u2026of<\/h2>\n<p>  <\/p>\n<p>\u041e\u0442\u00a0<code>for<\/code>\u00a0\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u00a0<code>forEach<\/code>\u00a0\u0430 \u043f\u043e\u0442\u043e\u043c \u043a\u00a0<code>for...of<\/code>:<\/p>\n<p>  <\/p>\n<pre><code>ES5 \/\/ for var array = ['a', 'b', 'c', 'd']; for (var i = 0; i &lt; array.length; i++) {   var element = array[i];   console.log(element); }  \/\/ forEach array.forEach(function (element) {   console.log(element); });<\/code><\/pre>\n<p>  <\/p>\n<p>ES6 for\u2026of \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b<\/p>\n<p>  <\/p>\n<pre><code>ES6 \/\/ for ...of const array = ['a', 'b', 'c', 'd']; for (const element of array) {     console.log(element); }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"parametry-po-umolchaniyu\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/h2>\n<p>  <\/p>\n<p>\u041e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u043d\u044c\u0448\u0435?<\/p>\n<p>  <\/p>\n<pre><code>ES5 function point(x, y, isFlag){   x = x || 0;   y = y || -1;   isFlag = isFlag || true;   console.log(x,y, isFlag); }  point(0, 0) \/\/ 0 -1 true  point(0, 0, false) \/\/ 0 -1 true  point(1) \/\/ 1 -1 true point() \/\/ 0 -1 true<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u0430. \u042d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u041d\u043e \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 8, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c\u00a0<code>0, 0<\/code>\u00a0\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u00a0<code>0, -1<\/code><\/li>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 9, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c\u00a0<code>false<\/code>, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u00a0<code>true<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e \u0431\u0443\u043b\u0435\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0, \u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041f\u043e\u0447\u0435\u043c\u0443? \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 ES6 \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u0412 ES6 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0435 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code>ES6 function point(x = 0, y = -1, isFlag = true){   console.log(x,y, isFlag); }  point(0, 0) \/\/ 0 0 true point(0, 0, false) \/\/ 0 0 false point(1) \/\/ 1 -1 true point() \/\/ 0 -1 true<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432 ES5 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u041d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 <code>undefined<\/code> \u0442\u0430\u043a \u043a\u0430\u043a <code>false<\/code>,\u00a0<code>null<\/code>,\u00a0<code>undefined<\/code> \u0438\u00a0<code>0<\/code> \u2013 \u044d\u0442\u043e \u0432\u0441\u0435 falsy-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0421 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code>ES5 function point(x, y, isFlag){   x = x || 0;   y = typeof(y) === 'undefined' ? -1 : y;   isFlag = typeof(isFlag) === 'undefined' ? true : isFlag;   console.log(x,y, isFlag); }  point(0, 0) \/\/ 0 0 true point(0, 0, false) \/\/ 0 0 false point(1) \/\/ 1 -1 true point() \/\/ 0 -1 true<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0430 <code>undefined<\/code> \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>  <\/p>\n<h2 id=\"rest-parametry\">Rest-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h2>\n<p>  <\/p>\n<p>\u041e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a rest-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 spread.<\/p>\n<p>  <\/p>\n<p>\u0412 ES5 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>  <\/p>\n<pre><code>ES5 function printf(format) {   var params = [].slice.call(arguments, 1);   console.log('params: ', params);   console.log('format: ', format); }  printf('%s %d %.2f', 'adrian', 321, Math.PI);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 rest \u00a0<code>...<\/code> \u0432\u0441\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>  <\/p>\n<pre><code>ES6 function printf(format, ...params) {   console.log('params: ', params);   console.log('format: ', format); }  printf('%s %d %.2f', 'adrian', 321, Math.PI);<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"operaciya-spread\">\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f Spread<\/h2>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043e\u0442\u00a0<code>apply()<\/code>\u00a0\u043a spread. \u041e\u043f\u044f\u0442\u044c \u0436\u0435,\u00a0<code>...<\/code>\u00a0\u0441\u043f\u0435\u0448\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c:<\/p>\n<p>  <\/p>\n<blockquote><p>\u041f\u043e\u043c\u043d\u0438\u0442\u0435: \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u00a0<code>apply()<\/code>\u00a0\u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>Math.max()<\/code>\u00a0\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>apply<\/code>.<\/p><\/blockquote>\n<p>  <\/p>\n<pre><code>ES5 Math.max.apply(Math, [2,100,1,6,43]) \/\/ 100<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 ES6 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c spread:<\/p>\n<p>  <\/p>\n<pre><code>ES6 Math.max(...[2,100,1,6,43]) \/\/ 100<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043e\u0442\u00a0<code>concat<\/code> \u043a spread&#8217;\u0443:<\/p>\n<p>  <\/p>\n<pre><code>ES5 var array1 = [2,100,1,6,43]; var array2 = ['a', 'b', 'c', 'd']; var array3 = [false, true, null, undefined];  console.log(array1.concat(array2, array3));<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 ES6:<\/p>\n<p>  <\/p>\n<pre><code>ES6 const array1 = [2,100,1,6,43]; const array2 = ['a', 'b', 'c', 'd']; const array3 = [false, true, null, undefined];  console.log([...array1, ...array2, ...array3]);<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>JavaScript \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a.<\/p>\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:\/\/habrahabr.ru\/post\/313526\/\"> https:\/\/habrahabr.ru\/post\/313526\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b. \u0412\u043e\u0442 12 \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f!<\/p>\n<p>  <\/p>\n<h1 id=\"istoriya\">\u0418\u0441\u0442\u043e\u0440\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u044f\u0437\u044b\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f ECMAScript 6. \u0418\u043b\u0438 ES6 \u0438\u043b\u0438 ES2015+.<\/p>\n<p>  <\/p>\n<p>\u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 1995, JavaScript \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442. ECMAScript \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 1997, \u0435\u0433\u043e \u0446\u0435\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 JavaScript \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u0440\u0443\u0441\u043b\u043e. \u0412\u044b\u0445\u043e\u0434\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u2013 ES3, ES5, ES6 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/504\/a78\/cba\/504a78cba9324062bb3d66d6af2e0588.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 ES3, ES5 \u0438 ES6 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0434\u043b\u0438\u043d\u043e\u0439 \u0432 10 \u0438 6 \u043b\u0435\u0442. \u041d\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u2013 \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u043e\u0434. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u0437\u0430 \u0440\u0430\u0437, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441 ES6.<\/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-279896","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279896","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=279896"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279896\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=279896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=279896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}