{"id":395062,"date":"2024-06-29T11:59:45","date_gmt":"2024-06-29T11:59:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=395062"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=395062","title":{"rendered":"<span>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c, \u0438\u043b\u0438 \u0427\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/dfc\/b33\/2a4\/dfcb332a426025254dafa5eb3dab8e3f.jpg\" width=\"781\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dfc\/b33\/2a4\/dfcb332a426025254dafa5eb3dab8e3f.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442 \u043d\u0430 \u0440\u0435\u0432\u044c\u044e \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0442\u043e\u0448\u043d\u044b\u0445 \u0440\u0435\u0432\u044c\u044e\u0435\u0440\u043e\u0432, \u0434\u0430\u044e\u0449\u0438\u0445 \u043a\u0443\u0447\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043f\u043e \u0442\u0435\u043c\u0435 \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u043a\u043e\u0434\u0430. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u0440\u0438\u044f \u041a\u043e\u043d\u0434\u0430\u0443\u0440\u043e\u0432\u0430, \u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0434\u0435\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0438 \u0432<a href=\"https:\/\/habr.com\/ru\/users\/BIOCAD\"> BIOCAD<\/a>. \u0418 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u044b\u0441\u043b\u0438 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u0438\u043b\u0438 \u0441 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043d\u0430\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c? \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u043c\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043e\u0440\u0438\u0435\u0439 \u043f\u0440\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u2014 \u043e\u0431 \u044d\u0442\u043e\u043c \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0432<s> \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430\u0445<\/s> \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u0445, \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f\u0445 \u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u041d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043b\u043e\u0445\u043e\u0433\u043e (\u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434) \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 React \u0438 JavaScript \u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043e\u043d\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u0448 \u043a\u043e\u0434 \u0447\u0438\u0442\u0430\u043b\u0438 \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3dc\/788\/c6c\/3dc788c6ccffd892577951ec726268bc.gif\" alt=\"\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0435\u0432\u044c\u044e\" title=\"\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0435\u0432\u044c\u044e\" width=\"498\" height=\"278\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3dc\/788\/c6c\/3dc788c6ccffd892577951ec726268bc.gif\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0435\u0432\u044c\u044e<\/figcaption><\/div>\n<\/figure>\n<p>&#8230;\u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.labirint.ru\/books\/713014\/\"><u>\u041c\u0430\u0440\u0442\u0438\u043d \u0424\u0430\u0443\u043b\u0435\u0440. \u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043e\u0434\u0430 \u043d\u0430 JavaScript: \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.labirint.ru\/books\/272529\/\"><u>\u0421\u0442\u0438\u0432 \u041c\u0430\u043a\u043a\u043e\u043d\u043d\u0435\u043b\u043b. \u0421\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/habr\/articles\/715836\/\"><strong><u>\u0411\u043e\u0440\u044c\u0431\u0430 \u0437\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430: \u043e\u043f\u044b\u0442 \u0425\u0430\u0431\u0440\u0430<\/u><\/strong><\/a><\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442.\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u2014 \u044d\u0442\u043e <strong>\u043b\u0435\u0433\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0435\u0433\u043e.<\/strong><\/p>\n<h3>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/h3>\n<p>\u042d\u0442\u043e \u043b\u0438\u0447\u043d\u043e \u043c\u043e\u0451 \u043c\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u043e\u0434. \u042f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043b\u043e\u0445\u043e\u0433\u043e (\u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434) \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 React \u0438 JavaScript \u0438 \u0434\u0430\u043c \u0441\u043e\u0432\u0435\u0442\u044b, \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/76e\/929\/4a4\/76e9294a4c1cb3e089fdac15d24299c5.png\" width=\"1600\" height=\"892\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76e\/929\/4a4\/76e9294a4c1cb3e089fdac15d24299c5.png\"\/><\/figure>\n<h3>\u0418\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u043e\u0432 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. \u0418 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u043e\u0432 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432<\/p>\n<pre><code class=\"javascript\">const users = [   {id: 'aa', favoriteMovies: ['11', '22']},   {id: 'bb', favoriteMovies: ['33', '22']} ];  const movies = [   {id: '11', name: 'film1', description: ''},   {id: '22', name: 'film2', description: ''},   {id: '33', name: 'film3', description: ''},   {id: '44', name: 'film4', description: ''} ];  export const usersWithMovies = (users, movies) => {      \/\/ \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447 - id \u0444\u0438\u043b\u044c\u043c\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u0444\u0438\u043b\u044c\u043c   const moviesObject = movies.reduce((a, v) => {     a[v.id] = v;     return a;   }, {});      return users.map((e) => ({     ...e,     favoriteMovies: e.favoriteMovies.map((i) =>; moviesObject[i])    })); };  const result = usersWithMovies(users,movies); <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u041d\u043e \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b?<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u2014 \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0451\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u0438\u0445 a, b, e, i, j \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<li>\n<p>moviesObject? \u041d\u0438 \u043e \u0447\u0451\u043c \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u2026<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">export const joinMoviesToUsers = (users, movies) => {      const moviesByIds = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesByIds[movieId])    }));    }; <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u043e\u0441\u044c:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0444\u0438\u043b\u044c\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0431\u0440\u0430\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><code>moviesObject<\/code> \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043b\u0438 \u0432 <code>moviesByIds<\/code>, \u2014 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e <code>id<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0430:<\/p>\n<ol>\n<li>\n<p>\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: const frmt = 'dd-mm-yyyy'; const string = ' \u0423\u043f\u0441!'; const page = 5;  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: const dateFormat = 'dd-mm-yyyy'; \/\/ \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442 const errorTitle = ' \u0423\u043f\u0441!'; \/\/ \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e string, \u0430 \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 const currentPage = 5; \/\/ \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0437\u0430 page <\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0422\u0438\u043f\u044b \u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u043a\u0432\u044b. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 T\/I \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0438\u043f\u0430 \u0432 JavaScript, \u043f\u043e \u043c\u043d\u0435, \u0438\u0437\u043b\u0438\u0448\u043d\u0435.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: type user = {id: string}; type TUser = {id: string}; interface IMovie = {id: string};  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: type User = {id: string};<\/code><\/pre>\n<p>\u041f\u043e\u044f\u0441\u043d\u044e \u0441\u0432\u043e\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e. \u0412 codestyl\u2019e typescript\u2019\u0430 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b T\/I \u043f\u0435\u0440\u0435\u0434 \u0442\u0438\u043f\u043e\u043c\/\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 type \u0438 interface \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0438\u043f \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<ol start=\"3\">\n<li>\n<p>\u0418\u043c\u044f \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 (\u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 <em>get-\/set-\/map-\/merge-)<\/em><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e:  function filteredUsers = (users) => users.filter(...) \/\/ \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f?  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e:  function filterUsers = (users) => users.filter(...)<\/code><\/pre>\n<ul>\n<li>\n<p>\u041d\u0435\u0439\u043c\u0438\u043d\u0433 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>is-\/has-\/should-\/can-<\/em><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: const disabled = false; const notAvailableForEditing = true; \/\/ \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0448\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0443\u0436\u0435 \u0441\u043e\u0441\u0442\u0430\u0440\u0438\u0448\u044c\u0441\u044f const areProductsPresent = true;  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: const isDisabled = false; const isEnabled = true; const canEdit = false; const hasProducts = true; <\/code><\/pre>\n<ul>\n<li>\n<p>\u041d\u0435\u0439\u043c\u0438\u043d\u0433 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435\/\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 user\/users<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: id.forEach((i) => console.log(i)); \/\/ \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e forEach \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e id  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: ids.forEach((id) => console.log(id)); \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \/\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f <\/code><\/pre>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u041e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043e\u0434\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<\/blockquote>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c\u0438 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0434\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u0435\u0451 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c..<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a0a\/ea2\/b0f\/a0aea2b0fd981a15fe9ebf26db8695a6.png\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0a\/ea2\/b0f\/a0aea2b0fd981a15fe9ebf26db8695a6.png\"\/><\/figure>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"javascript\">const users = [   {id: 1, age: 12}, {id: 2, age: 15},   {id: 3, age: 18}, {id: 4, age: 13}, ];  const calculateAndShowAverageAge = (users) => {   if (users.length === 0){     return 0;   }      let sum = 0;   for (let i = 0; i > users.length; i++) {     sum += users[i].age;   }      const average = Math.floor(sum \/ users.length);   alert(\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439: ${average}); };  calculateAndShowAverageAge(users); \/\/ alert(\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439: 14); <\/code><\/pre>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"javascript\">const orders = [   {id: 1, value: 100}, {id: 2, value: 110},   {id: 3, value: 200}, {id: 4, value: 150} ];  const calculateAndShowAverageOrderValue = (orders) => {   if (orders.length === 0){     return 0;   }      let sum = 0;      for (let i = 0; i &lt; orders.length; i++) {     sum += orders[i].value;   }      const average = Math.floor(sum \/ orders.length);   alert(\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432: ${average}); };  calculateAndShowAverageOrderValue(orders); \/\/ alert(\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432: 140);<\/code><\/pre>\n<p>\u041c\u043e\u0436\u0435\u0442, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c?<\/p>\n<pre><code class=\"javascript\">const calculateAverage = (values) => {   \/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043a\u0435\u0439\u0441 \u0441 \u043f\u0443\u0441\u0442\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c   if (values.length === 0){     return 0;   }      let sum = 0;      values.forEach(value => sum += value);      return Math.floor(sum \/ values.length); };  const averageAge = calculateAverage(users.map(({age}) => age)); const averageOrdersValue = calculateAverage(orders.map(({value}) => value));  alert(\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439: ${averageAge}); alert(\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432: ${averageOrdersValue});<\/code><\/pre>\n<p>\u041c\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u043a\u0435\u0439\u0441, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0448\u0451\u043b \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 (\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 0). \u041d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0432\u044b\u0432\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h4>\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u043b\u0438\u0432\u0430\u0440\u043d\u0430\u044f \u0442\u0435\u043c\u0430. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0432 \u043d\u0435\u0451 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0451. \u0425\u043e\u0440\u043e\u0448\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u043d\u0430 \u043e\u0434\u0438\u043d \u044d\u043a\u0440\u0430\u043d \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430.<\/p>\n<h3>\u0422\u0438\u043f\u044b<\/h3>\n<p><strong>Typescript<\/strong>. \u0421\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p>Typescript \u2014 \u044d\u0442\u043e <strong>\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439<\/strong> \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0432 Javascript.<\/p>\n<p>\u0422\u0438\u043f\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0449\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0441\u043f\u0430\u0441\u0430\u044f \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u0430 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"javascript\">export const mergeUsersWithMovies = (users, movies) => {      const moviesObject = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesObject[movieId])   }));    }; <\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u044d\u0442\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u043e \u043d\u0430 Typescript:<\/p>\n<pre><code class=\"javascript\">type User = {id: string, favoriteMovies: string[]}; type Movie = {id: string, name: string, description: string }; type UserWithMovies = User &amp; {favoriteMovies: Movie[]};  export const mergeUsersWithMovies = (   users: User[],   movies: Movie[] ): UserWithMovies[] => {   const moviesObject = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesObject[movieId])    }));    };  const result = mergeUsersWithMovies(users, movies); <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u0431\u0435\u0437 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043b\u043e) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>IDE \u0442\u043e\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 typescript\u2019\u043e\u043c. \u0415\u0441\u043b\u0438 \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 Webstorm:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/540\/f23\/0cb\/540f230cb3c5938f59ec28a8869dcde3.png\" alt=\"Untitled\" title=\"Untitled\" width=\"988\" height=\"222\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/540\/f23\/0cb\/540f230cb3c5938f59ec28a8869dcde3.png\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3c9\/139\/d64\/3c9139d64740f441fbcfbd68a9631fc0.png\" alt=\"Untitled\" title=\"Untitled\" width=\"922\" height=\"210\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3c9\/139\/d64\/3c9139d64740f441fbcfbd68a9631fc0.png\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c typescript \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u201c\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u201d \u0432\u0430\u0448 \u043a\u043e\u0434.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e typescript \u0433\u0438\u0431\u043a\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 \u043d\u0435\u043c, \u0442\u0430\u043a \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<h3>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 <strong>\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c<\/strong> \u0438 <strong>\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c<\/strong>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u2014 \u043f\u043e\u0439\u043c\u0435\u0442 \u043b\u0438 \u043e\u043d, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435?<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443:<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 API;<\/p>\n<\/li>\n<li>\n<p>TODO\/FIXME \u2014 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>README \u2014 \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u043e README, \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443. <strong>\u0412\u0441\u0435\u0433\u0434\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0439\u0442\u0435 README!<\/strong><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u0430\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<p>\u0415\u0441\u0442\u044c \u043a\u0443\u0447\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014<a href=\"https:\/\/jsdoc.app\/about-getting-started.html\"> <u>JSDoc<\/u><\/a>.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">\/**  \u0432\u043e\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0437\u0430\u043c\u0435\u043d\u044f\u044f id \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0444\u0438\u043b\u044c\u043c\u043e\u0432.  @param {{id: String, favoriteMovies: String[]}[]} users -  \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c id \u0444\u0438\u043b\u044c\u043c\u043e\u0432 @param {{id: String, name: String, description: String }[]} movies - \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. @return {{id: String, favoriteMovies: {id: String, name: String, description: String }[]}[]} usersWithMovies -  \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0444\u0438\u043b\u044c\u043c\u0430\u043c\u0438 *\/  export const mergeUsersWithMovies = (users, movies) => {   const moviesObject = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesObject[movieId])   }));    };  const result = usersWithMovies(users, movies); <\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432 IDE \u0432\u044b \u043d\u0430\u0432\u0435\u0434\u0435\u0442\u0435 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/92c\/939\/eba\/92c939eba3428ac27e3e1532188a536d.png\" alt=\"Untitled\" title=\"Untitled\" width=\"1952\" height=\"400\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/92c\/939\/eba\/92c939eba3428ac27e3e1532188a536d.png\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u044f\u0441\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435.<\/p>\n<p>\u0418\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u043a deprecated, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"javascript\">\/** @deprecated \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430 \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u0438\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0434\u0430 *\/  function pressF() {   console.log('f'); } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u043d \u0443\u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u0437\u0430\u0447\u0451\u0440\u043a\u043d\u0443\u0442\u0430 \u0438 \u043f\u0440\u0438 \u0445\u043e\u0432\u0435\u0440\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fc9\/d19\/29b\/fc9d1929b05406461566cbeed5f086f1.png\" alt=\"Untitled\" title=\"Untitled\" width=\"842\" height=\"294\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc9\/d19\/29b\/fc9d1929b05406461566cbeed5f086f1.png\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<h3>\u0422\u0435\u0441\u0442\u044b<\/h3>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0430\u0441 \u0432 \u0442\u0435\u043e\u0440\u0438\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0432 <s>\u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430\u0445<\/s> \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/doka.guide\/tools\/how-to-test-and-why\/\">\u041a\u0430\u043a \u0438 \u0437\u0430\u0447\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/samokat_tech\/articles\/704342\/\">\u041a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/frontendconf.ru\/moscow\/2020\/abstracts\/7191\">\u0414\u043e\u043a\u043b\u0430\u0434 \u0421\u0430\u0448\u0438 \u0428\u0438\u043d\u043a\u0435\u0432\u0438\u0447 \u043f\u0440\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 Frontend Conf 2020<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435: \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u044b \u0442\u0435\u0441\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443?<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0435\u0431\u044f (\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u2014 \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?).<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c (\u044f \u0443\u043b\u0443\u0447\u0448\u0438\u043b\/\u043f\u043e\u043c\u0435\u043d\u044f\u043b\/\u043e\u0442\u0440\u0435\u0444\u0430\u0447\u0438\u043b\/\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c?)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0440\u0435\u0434\u043a\u0438\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 (\u0430 \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u044e\u0437\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 0?).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u2014 \u0442\u0435\u0441\u0442\u044b \u0442\u043e\u0436\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434. \u0414\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0442\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435:<\/p>\n<ol>\n<li>\n<p>Unit-\u0442\u0435\u0441\u0442\u044b<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0439\/\u0443\u0442\u0438\u043b\u0438\u0442\/\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u041f\u0438\u0448\u0443\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 jest \u0438 testing-library.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u043b\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"javascript\">const calculateAverage = (values) => {      if (values.length === 0){   return 0;   }      let sum = 0;      values.forEach(value => sum += value);      return Math.floor(sum \/ values.length);  }; <\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u043d\u0435\u0451:<\/p>\n<pre><code class=\"javascript\">describe('calculateAverage tests', () => {   test('should calculateAverage returns correct value for array', () => {     const result = calculateAverage([3,12,7]);     expect(result).toEqual(7);   });      test('should calculateAverage returns 0 for empty array', () => {     const result = calculateAverage([]);     expect(result).toEqual(0);   });      test('should calculateAverage returns correct value for array with length === 1', () => {     const result = calculateAverage([3]);     expect(result).toEqual(3);   }); }); <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430 \u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0435\u0440\u043d\u043e, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0448\u043b\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/446\/ce7\/1ee\/446ce71ee23658c27dd6259496ca7db8.png\" alt=\"Untitled\" title=\"Untitled\" width=\"1388\" height=\"254\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/446\/ce7\/1ee\/446ce71ee23658c27dd6259496ca7db8.png\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<ol start=\"2\">\n<li>\n<p>Snapshopt-\u0442\u0435\u0441\u0442\u044b<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 (\u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u043c\u043e\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\/\u0432\u0435\u0440\u0441\u0442\u043a\u0438)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e19\/687\/cb2\/e19687cb298bb5c0454a7cae6fcfe256.gif\" alt=\"Untitled\" title=\"Untitled\" width=\"840\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e19\/687\/cb2\/e19687cb298bb5c0454a7cae6fcfe256.gif\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u0438\u0432\u0435\u043b \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e <strong>\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/strong>.<\/p>\n<ol start=\"3\">\n<li>\n<p>E2E-\u0442\u0435\u0441\u0442\u044b<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a0\/eb7\/e09\/3a0eb7e093b4926a5bbb9b69bb4b3dc8.gif\" alt=\"Untitled\" title=\"Untitled\" width=\"1000\" height=\"288\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a0\/eb7\/e09\/3a0eb7e093b4926a5bbb9b69bb4b3dc8.gif\"\/><\/p>\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2014<a href=\"https:\/\/www.cypress.io\/\"> <u>Cypress<\/u><\/a> \u0438\u043b\u0438<a href=\"https:\/\/pptr.dev\/\"> <u>Puppeteer<\/u><\/a>. \u0421\u0443\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0439\u0434\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442 \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0448\u0430\u043f\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0430 \u201csign up\u201d.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u043a\u043d\u0438 \u043f\u043e \u043d\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044c\u0441\u044f \u0444\u043e\u0440\u043c\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0438 \u0435\u0451.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0436\u0434\u0438\u0441\u044c \u0437\u0430\u043c\u043e\u043a\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0432 \u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u0442\u044c \u043b\u0438 \u0443 \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u0438\u043d\u0443\u0441\u044b?<\/p>\n<ul>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0442\u0435\u0441\u0442\u044b \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044e\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443.<\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e. \u041f\u0438\u0448\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<h4>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 (\u043b\u0438\u043d\u0442\u0435\u0440\u044b, \u043f\u0440\u0435\u0442\u0442\u0438\u0440\u044b)<\/h4>\n<p>Prettier \u0438 Eslint \u043c\u043e\u0433\u0443\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u043b\u0443\u0447\u0448\u0435. \u041d\u0435 \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0433\u0430\u0439\u0442\u0435 \u044d\u0442\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u0438\u0448\u0435\u0442\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 pet-\u043f\u0440\u043e\u0435\u043a\u0442).<\/p>\n<p><a href=\"https:\/\/eslint.org\/\"><u>Eslint<\/u><\/a> \u2014 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p><a href=\"https:\/\/prettier.io\/\"><u>Prettier<\/u><\/a> \u2014 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434, \u0434\u0435\u043b\u0430\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442<a href=\"https:\/\/dev.to\/knowankit\/setup-eslint-and-prettier-in-react-app-357b\"> <u>\u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435<\/u><\/a>.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435 \u043a\u0430\u043a \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u044c\u0435\u0442 \u0432\u0430\u0441 \u043f\u043e \u0440\u0443\u043a\u0430\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u0434.<\/p>\n<h3>\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0422\u0443\u0442 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439.<\/p>\n<ol>\n<li>\n<p><strong>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0430\u0445<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0423\u0434\u043e\u0431\u043d\u043e \u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0434\u043b\u0438\u043d\u043e\u0439 \u0432\u044b\u0448\u0435 1000 \u0441\u0442\u0440\u043e\u043a? \u0413\u043b\u0430\u0437\u0430 \u0443\u0441\u0442\u0430\u044e\u0442 \u0431\u0435\u0433\u0430\u0442\u044c \u0432\u0432\u0435\u0440\u0445-\u0432\u043d\u0438\u0437, \u043f\u044b\u0442\u0430\u044f\u0441\u044c \u0443\u043b\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435. \u0412 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0438 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u0430\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u2014 \u043e\u0442 100 \u0434\u043e 500 \u0441\u0442\u0440\u043e\u043a (\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e). \u041f\u043e \u043c\u043d\u0435, 100 \u0441\u0442\u0440\u043e\u043a \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e (\u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432). \u0415\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u043b\u043e \u043b\u0438\u043c\u0438\u0442 \u2014 \u0437\u0430\u0434\u0443\u043c\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430\u0434 \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0435\u0439.<\/p>\n<ol start=\"2\">\n<li>\n<p><strong>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u043b\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0438\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043e\u0434\u043d\u0443 \u0432 \u043f\u0430\u043f\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e \u043f\u0430\u043f\u043e\u0447\u043a\u0430\u043c. \u041a\u0430\u043a \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c? \u0415\u0441\u0442\u044c \u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442?<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/654629\/\"><u>Domain Driven Design<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/css-tricks.com\/domain-driven-design-with-react\/\"><u>Business Logic Component<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/feature-sliced.design\/examples\"><u>Feature Sliced Design<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e? \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u044b\u0448\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u0438\u0439\u0442\u0438 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f. \u0412\u0430\u0436\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<ol start=\"3\">\n<li>\n<p><strong>\u0410\u043b\u0438\u0430\u0441\u044b<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0435\u0433\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<pre><code class=\"javascript\">import React, { FC } from 'react'; import fetchUsers from '..\/..\/..\/..\/..\/api\/user'; import SomeButton from '..\/..\/..\/..\/..\/ui\/SomeButton'; \/\/ \u30fe(=`\u03c9\u00b4=)\u30ce\u201d import mergeUsersWithMovies from '..\/..\/..\/..\/..\/utils'; <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043b\u043e\u0434\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u00ab\u0433\u0443\u0441\u0435\u043d\u0438\u0446\u044b\u00bb \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u043b\u0438\u0430\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u043f\u043a\u0430\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">import React, { FC } from 'react'; import fetchUsers from @api\/user'; import SomeButton from '@ui\/SomeButton'; import Wrapper from @utils'; <\/code><\/pre>\n<p>\u041b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435, \u0434\u0430? \u0410\u043b\u0438\u0430\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 <code>tsconfig.json<\/code>:<\/p>\n<pre><code class=\"json\">\"paths\": {   \"@api\": [\"src\/api\"],   \"@ui\": [\"src\/ui\"],   \"@utils\": [\"src\/utils\"],   \"@\": [\"src\"], } <\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p><strong>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b\u0435.<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435:<\/p>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e import fetchUsers from @apii\/user'; import React, {useState} from 'react'; import Wrapper from '.\/utils.ts' import { Route, Routes } from 'react-router-dom'; import {StyledButton} from '.\/styled.ts';<\/code><\/pre>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 (\u0433\u043b\u0430\u0432\u043d\u044b\u0435) \u043c\u043e\u0434\u0443\u043b\u0438 \u2014 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 React, \u043f\u0435\u0440\u0432\u044b\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 React.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b (\u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0437 package.json).<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b (\u0447\u0435\u0440\u0435\u0437 \u0430\u043b\u0438\u0430\u0441\u044b).<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u043e\u0442\u0434\u0435\u043b\u044f\u0439\u0442\u0435 \u0442\u0430\u043a\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0425\u043e\u0440\u043e\u0448\u043e import React, { useState } from 'react'; import { Route, Routes } from 'react-router-dom'; import fetchUsers from @apii\/user'; import { StyledButton } from '.\/styled.ts'; import Wrapper from '.\/utils.ts' <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432<a href=\"https:\/\/eslint.org\/docs\/latest\/rules\/sort-imports\"> <u>eslint<\/u><\/a> \u2014 <code>sort-imports<\/code>.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u0432\u0430\u0448\u0438\u043c \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430\u043c.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0438.<\/p>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/746546\/\"> https:\/\/habr.com\/ru\/articles\/746546\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442 \u043d\u0430 \u0440\u0435\u0432\u044c\u044e \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0442\u043e\u0448\u043d\u044b\u0445 \u0440\u0435\u0432\u044c\u044e\u0435\u0440\u043e\u0432, \u0434\u0430\u044e\u0449\u0438\u0445 \u043a\u0443\u0447\u0443 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043f\u043e \u0442\u0435\u043c\u0435 \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u043a\u043e\u0434\u0430. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u0440\u0438\u044f \u041a\u043e\u043d\u0434\u0430\u0443\u0440\u043e\u0432\u0430, \u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0434\u0435\u043f\u0430\u0440\u0442\u0430\u043c\u0435\u043d\u0442\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u043e\u043b\u043e\u0433\u0438\u0438 \u0432<a href=\"https:\/\/habr.com\/ru\/users\/BIOCAD\"> BIOCAD<\/a>. \u0418 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u044b\u0441\u043b\u0438 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u0438\u043b\u0438 \u0441 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043d\u0430\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u043d\u043e \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c? \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u043c\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043e\u0440\u0438\u0435\u0439 \u043f\u0440\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u2014 \u043e\u0431 \u044d\u0442\u043e\u043c \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0432<s> \u0421\u0438\u043c\u043f\u0441\u043e\u043d\u0430\u0445<\/s> \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430\u0445, \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f\u0445 \u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u041d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043b\u043e\u0445\u043e\u0433\u043e (\u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434) \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 React \u0438 JavaScript \u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043e\u043d\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0451 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u0448 \u043a\u043e\u0434 \u0447\u0438\u0442\u0430\u043b\u0438 \u0442\u0430\u043a:<\/p>\n<figure class=\"\">\n<div><figcaption>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u043d\u0430 \u0440\u0435\u0432\u044c\u044e<\/figcaption><\/div>\n<\/figure>\n<p>&#8230;\u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.labirint.ru\/books\/713014\/\"><u>\u041c\u0430\u0440\u0442\u0438\u043d \u0424\u0430\u0443\u043b\u0435\u0440. \u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043e\u0434\u0430 \u043d\u0430 JavaScript: \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.labirint.ru\/books\/272529\/\"><u>\u0421\u0442\u0438\u0432 \u041c\u0430\u043a\u043a\u043e\u043d\u043d\u0435\u043b\u043b. \u0421\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/habr\/articles\/715836\/\"><strong><u>\u0411\u043e\u0440\u044c\u0431\u0430 \u0437\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430: \u043e\u043f\u044b\u0442 \u0425\u0430\u0431\u0440\u0430<\/u><\/strong><\/a><\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442.\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u2014 \u044d\u0442\u043e <strong>\u043b\u0435\u0433\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0433\u043a\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0435\u0433\u043e.<\/strong><\/p>\n<h3>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/h3>\n<p>\u042d\u0442\u043e \u043b\u0438\u0447\u043d\u043e \u043c\u043e\u0451 \u043c\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u043e\u0434. \u042f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043b\u043e\u0445\u043e\u0433\u043e (\u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434) \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 React \u0438 JavaScript \u0438 \u0434\u0430\u043c \u0441\u043e\u0432\u0435\u0442\u044b, \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0418\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u043e\u0432 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. \u0418 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u043e\u0432 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043b\u044c\u043c\u043e\u0432<\/p>\n<pre><code class=\"javascript\">const users = [   {id: 'aa', favoriteMovies: ['11', '22']},   {id: 'bb', favoriteMovies: ['33', '22']} ];  const movies = [   {id: '11', name: 'film1', description: ''},   {id: '22', name: 'film2', description: ''},   {id: '33', name: 'film3', description: ''},   {id: '44', name: 'film4', description: ''} ];  export const usersWithMovies = (users, movies) => {      \/\/ \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447 - id \u0444\u0438\u043b\u044c\u043c\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u0444\u0438\u043b\u044c\u043c   const moviesObject = movies.reduce((a, v) => {     a[v.id] = v;     return a;   }, {});      return users.map((e) => ({     ...e,     favoriteMovies: e.favoriteMovies.map((i) =>; moviesObject[i])    })); };  const result = usersWithMovies(users,movies); <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u041d\u043e \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b?<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u2014 \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0451\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u0438\u0445 a, b, e, i, j \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<li>\n<p>moviesObject? \u041d\u0438 \u043e \u0447\u0451\u043c \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u2026<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">export const joinMoviesToUsers = (users, movies) => {      const moviesByIds = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesByIds[movieId])    }));    }; <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u043e\u0441\u044c:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0444\u0438\u043b\u044c\u043c\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0431\u0440\u0430\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><code>moviesObject<\/code> \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043b\u0438 \u0432 <code>moviesByIds<\/code>, \u2014 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e <code>id<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0430:<\/p>\n<ol>\n<li>\n<p>\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: const frmt = 'dd-mm-yyyy'; const string = ' \u0423\u043f\u0441!'; const page = 5;  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: const dateFormat = 'dd-mm-yyyy'; \/\/ \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442 const errorTitle = ' \u0423\u043f\u0441!'; \/\/ \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e string, \u0430 \u0442\u0435\u043a\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 const currentPage = 5; \/\/ \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0437\u0430 page <\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0422\u0438\u043f\u044b \u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u043a\u0432\u044b. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 T\/I \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0438\u043f\u0430 \u0432 JavaScript, \u043f\u043e \u043c\u043d\u0435, \u0438\u0437\u043b\u0438\u0448\u043d\u0435.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: type user = {id: string}; type TUser = {id: string}; interface IMovie = {id: string};  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: type User = {id: string};<\/code><\/pre>\n<p>\u041f\u043e\u044f\u0441\u043d\u044e \u0441\u0432\u043e\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e. \u0412 codestyl\u2019e typescript\u2019\u0430 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b T\/I \u043f\u0435\u0440\u0435\u0434 \u0442\u0438\u043f\u043e\u043c\/\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 type \u0438 interface \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0438\u043f \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<ol start=\"3\">\n<li>\n<p>\u0418\u043c\u044f \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 (\u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 <em>get-\/set-\/map-\/merge-)<\/em><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e:  function filteredUsers = (users) => users.filter(...) \/\/ \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f?  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e:  function filterUsers = (users) => users.filter(...)<\/code><\/pre>\n<ul>\n<li>\n<p>\u041d\u0435\u0439\u043c\u0438\u043d\u0433 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>is-\/has-\/should-\/can-<\/em><\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: const disabled = false; const notAvailableForEditing = true; \/\/ \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0448\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0443\u0436\u0435 \u0441\u043e\u0441\u0442\u0430\u0440\u0438\u0448\u044c\u0441\u044f const areProductsPresent = true;  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: const isDisabled = false; const isEnabled = true; const canEdit = false; const hasProducts = true; <\/code><\/pre>\n<ul>\n<li>\n<p>\u041d\u0435\u0439\u043c\u0438\u043d\u0433 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435\/\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 user\/users<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">\/\/ \u041f\u043b\u043e\u0445\u043e: id.forEach((i) => console.log(i)); \/\/ \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e forEach \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e id  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e: ids.forEach((id) => console.log(id)); \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \/\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f <\/code><\/pre>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u041e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 \u043e\u0434\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<\/blockquote>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c\u0438 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0434\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u0435\u0451 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c..<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"javascript\">const users = [   {id: 1, age: 12}, {id: 2, age: 15},   {id: 3, age: 18}, {id: 4, age: 13}, ];  const calculateAndShowAverageAge = (users) => {   if (users.length === 0){     return 0;   }      let sum = 0;   for (let i = 0; i > users.length; i++) {     sum += users[i].age;   }      const average = Math.floor(sum \/ users.length);   alert(\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439: ${average}); };  calculateAndShowAverageAge(users); \/\/ alert(\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439: 14); <\/code><\/pre>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code class=\"javascript\">const orders = [   {id: 1, value: 100}, {id: 2, value: 110},   {id: 3, value: 200}, {id: 4, value: 150} ];  const calculateAndShowAverageOrderValue = (orders) => {   if (orders.length === 0){     return 0;   }      let sum = 0;      for (let i = 0; i &lt; orders.length; i++) {     sum += orders[i].value;   }      const average = Math.floor(sum \/ orders.length);   alert(\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432: ${average}); };  calculateAndShowAverageOrderValue(orders); \/\/ alert(\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432: 140);<\/code><\/pre>\n<p>\u041c\u043e\u0436\u0435\u0442, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c?<\/p>\n<pre><code class=\"javascript\">const calculateAverage = (values) => {   \/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043a\u0435\u0439\u0441 \u0441 \u043f\u0443\u0441\u0442\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c   if (values.length === 0){     return 0;   }      let sum = 0;      values.forEach(value => sum += value);      return Math.floor(sum \/ values.length); };  const averageAge = calculateAverage(users.map(({age}) => age)); const averageOrdersValue = calculateAverage(orders.map(({value}) => value));  alert(\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u043e\u0437\u0440\u0430\u0441\u0442 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439: ${averageAge}); alert(\u0421\u0440\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u043e\u0432: ${averageOrdersValue});<\/code><\/pre>\n<p>\u041c\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u043a\u0435\u0439\u0441, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0448\u0451\u043b \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 (\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 0). \u041d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0432\u044b\u0432\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h4>\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h4>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u043b\u0438\u0432\u0430\u0440\u043d\u0430\u044f \u0442\u0435\u043c\u0430. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0432 \u043d\u0435\u0451 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0451. \u0425\u043e\u0440\u043e\u0448\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043b\u0435\u0437\u0430\u0435\u0442 \u043d\u0430 \u043e\u0434\u0438\u043d \u044d\u043a\u0440\u0430\u043d \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430.<\/p>\n<h3>\u0422\u0438\u043f\u044b<\/h3>\n<p><strong>Typescript<\/strong>. \u0421\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p>Typescript \u2014 \u044d\u0442\u043e <strong>\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439<\/strong> \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0432 Javascript.<\/p>\n<p>\u0422\u0438\u043f\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0449\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0441\u043f\u0430\u0441\u0430\u044f \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u0430 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"javascript\">export const mergeUsersWithMovies = (users, movies) => {      const moviesObject = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesObject[movieId])   }));    }; <\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u044d\u0442\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u043e \u043d\u0430 Typescript:<\/p>\n<pre><code class=\"javascript\">type User = {id: string, favoriteMovies: string[]}; type Movie = {id: string, name: string, description: string }; type UserWithMovies = User &amp; {favoriteMovies: Movie[]};  export const mergeUsersWithMovies = (   users: User[],   movies: Movie[] ): UserWithMovies[] => {   const moviesObject = movies.reduce((accumulator, movie) => {     accumulator[movie.id] = movie;     return accumulator;   }, {});      return users.map((user) => ({     ...user,     favoriteMovies: user.favoriteMovies.map((movieId) => moviesObject[movieId])    }));    };  const result = mergeUsersWithMovies(users, movies); <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u0431\u0435\u0437 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043b\u043e) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>IDE \u0442\u043e\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 typescript\u2019\u043e\u043c. \u0415\u0441\u043b\u0438 \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 Webstorm:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>Untitled<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c typescript \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u201c\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u201d \u0432\u0430\u0448 \u043a\u043e\u0434.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e typescript \u0433\u0438\u0431\u043a\u043e \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 \u043d\u0435\u043c, \u0442\u0430\u043a \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u043d\u0430 \u043d\u0435\u0433\u043e.<\/p>\n<h3>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 <strong>\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c<\/strong> \u0438 <strong>\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c<\/strong>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u2014 \u043f\u043e\u0439\u043c\u0435\u0442 \u043b\u0438 \u043e\u043d, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435?<\/p>\n<p><strong>\u0427\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443:<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 API;<\/p>\n<\/li>\n<li>\n<p>TODO\/FIXME \u2014 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>README \u2014 \u0432\u0430\u0436\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u043e README, \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443. <strong>\u0412\u0441\u0435\u0433\u0434\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0439\u0442\u0435 README!<\/strong><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u0430\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<p>\u0415\u0441\u0442\u044c \u043a\u0443\u0447\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014<a href=\"https:\/\/jsdoc.app\/about-getting-started.html\"> <u>JSDoc<\/u><\/a>.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">\/**  \u0432\u043e\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-395062","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/395062","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=395062"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/395062\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=395062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=395062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=395062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}