{"json_modified": "2019-02-06T03:04:26.217693", "uuid": "0296d25c-9985-4d1e-91d3-3b8039b84379", "title": "Array.prototype.flatMap()", "url": "/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": ["Reference", "Array", "Prototype", "JavaScript", "Method"], "translations": [{"uuid": "30c4dc50-63f8-4471-b328-e09d321ee6cc", "title": "Array.prototype.flatMap()", "url": "/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": ["Reference", "Experimental", "Array", "Prototype", "JavaScript", "Method"], "summary": "The <code><strong>flatMap()</strong></code> method first maps each element using a mapping function, then flattens the result into a new array. It is identical to a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a> followed by a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\">flat</a> of depth 1, but <code>flatMap</code> is often quite useful, as merging both into one method is slightly more efficient.", "localization_tags": [], "locale": "en-US", "last_edit": "2019-02-03T11:32:18.002397", "review_tags": ["technical"]}, {"uuid": "9990e855-7566-44d6-a34c-558a1857ed52", "title": "Array.prototype.flatMap()", "url": "/de/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": ["Reference", "Experimental", "Array", "Prototype", "JavaScript", "Method"], "summary": "Die <code><strong>flatMap()</strong></code> Methode bildet jedes Element \u00fcber eine Funktion ab und flacht das Ergebnis in ein Array ab. Sie ist identisch zu einem <a href=\"/de/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a> gefolgt von einem <a href=\"/de/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\">flat</a> der Tiefe 1, aber <code>flatMap</code> ist\u00a0<span lang=\"de\" id=\"result_box\"><span>oft n\u00fctzlich und beide in einer Methode zusammenf\u00fchren ist etwas effizienter.</span></span>", "localization_tags": [], "locale": "de", "last_edit": "2018-06-06T23:10:34.654865", "review_tags": []}, {"uuid": "8db06770-0faa-4b9c-975a-2e2844eb1df6", "title": "Array.prototype.flatMap()", "url": "/es/docs/Web/JavaScript/Referencia/Objetos_globales/Array/flatMap", "tags": ["Prototipo", "Referencia", "Experimental", "Array", "metodo", "JavaScript"], "summary": "El m\u00e9todo <code><strong>flatMap()</strong></code> primero mapea cada elemento usando una funci\u00f3n de mapeo, luego aplana el resultado en una nueva matriz. Es id\u00e9ntico a un <a href=\"/es/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a>\u00a0seguido de un <a href=\"/es/docs/Web/JavaScript/Reference/Global_Objects/Array/flatten\">flatten </a>de\u00a0profundidad 1, pero <code>flatMap</code> es a menudo \u00fatil y la fusi\u00f3n de ambos en un m\u00e9todo es ligeramente m\u00e1s eficiente.", "localization_tags": [], "locale": "es", "last_edit": "2018-04-30T22:01:47.325655", "review_tags": []}, {"uuid": "627889a6-28ed-4d8a-8b5a-d136beb7557c", "title": "Array.prototype.flatMap()", "url": "/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/flatMap", "tags": ["Reference", "Experimental", "Array", "Prototype", "JavaScript", "M\u00e9thode"], "summary": "La m\u00e9thode <code><strong>flatMap()</strong></code> permet d'appliquer une fonction \u00e0 chaque \u00e9l\u00e9ment du tableau puis d'aplatir le r\u00e9sultat en un tableau. Cela correspond \u00e0 l'encha\u00eenement de <a href=\"/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/map\" title=\"La m\u00e9thode map() cr\u00e9e un nouveau tableau avec les r\u00e9sultats de l'appel d'une fonction fournie sur chaque \u00e9l\u00e9ment du tableau appelant.\"><code>Array.prototype.map()</code></a> suivi de <a href=\"/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/flat\" title=\"La m\u00e9thode flat() permet de cr\u00e9er un nouveau tableau contenant les \u00e9l\u00e9ments des sous-tableaux du tableau pass\u00e9 en argument, qui sont concat\u00e9n\u00e9s r\u00e9cursivement pour atteindre une profondeur donn\u00e9e.\"><code>Array.prototype.flat()</code></a> de profondeur 1. <code>flatMap</code> est plus efficace que la combinaison de ces deux op\u00e9rations, souvent r\u00e9alis\u00e9es conjointement.", "localization_tags": [], "locale": "fr", "last_edit": "2019-02-03T22:47:56.034843", "review_tags": []}, {"uuid": "9939991f-07de-4b20-8773-2fdff34222f8", "title": "Array.prototype.flatMap()", "url": "/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": ["Reference", "Experimental", "Array", "Prototype", "JavaScript", "Method"], "summary": "<code><strong>flatMap()</strong></code> \u30e1\u30bd\u30c3\u30c9\u306f\u3001\u6700\u521d\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u305d\u308c\u305e\u308c\u306e\u8981\u7d20\u3092\u30de\u30c3\u30d7\u3057\u305f\u5f8c\u3001\u7d50\u679c\u3092\u65b0\u3057\u3044\u914d\u5217\u5185\u306b\u30d5\u30e9\u30c3\u30c8\u5316\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u6df1\u3055 1 \u306e <a href=\"/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/flatten\">flatten</a> \u304c\u7d9a\u304f <a href=\"/jaS/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a> \u3068\u540c\u3058\u3067\u3059\u304c\u3001<code>flatMap</code> \u306f\u3057\u3070\u3057\u3070\u6709\u7528\u3067\u3042\u308a\u30012 \u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3092 1 \u3064\u306b\u30de\u30fc\u30b8\u3059\u308b\u3088\u308a\u3082\u3084\u3084\u52b9\u679c\u7684\u3067\u3059\u3002", "localization_tags": [], "locale": "ja", "last_edit": "2018-03-31T20:20:56.807114", "review_tags": ["editorial"]}, {"uuid": "05756d59-6c4d-4d00-8cad-216601fff86e", "title": "Array.prototype.flatMap()", "url": "/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": ["Reference", "JavaScript", "Array", "Prototype", "Method", "Experimental"], "summary": "<code><strong>flatMap()</strong></code> \uba54\uc11c\ub4dc\ub294 \uba3c\uc800 \ub9e4\ud551\ud568\uc218\ub97c \uc0ac\uc6a9\ud574 \uac01 \uc5d8\ub9ac\uba3c\ud2b8\uc5d0 \ub300\ud574 map \uc218\ud589 \ud6c4, \uacb0\uacfc\ub97c \uc0c8\ub85c\uc6b4 \ubc30\uc5f4\ub85c \ud3c9\ud3c9\ud654\ud569\ub2c8\ub2e4. \uc774\ub294 \uae4a\uc774 1\uc758 <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\">flat</a> \uc774 \ub4a4\ub530\ub974\ub294 <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a> \uacfc \ub3d9\uc77c\ud558\uc9c0\ub9cc, <code>flatMap</code> \uc740 \uc544\uc8fc \uc720\uc6a9\ud558\uba70 \ub458\uc744 \ud558\ub098\uc758 \uba54\uc18c\ub4dc\ub85c \ubcd1\ud569\ud560 \ub54c \uc870\uae08 \ub354 \ud6a8\uc728\uc801\uc785\ub2c8\ub2e4.", "localization_tags": ["inprogress"], "locale": "ko", "last_edit": "2018-11-22T22:09:10.568294", "review_tags": []}, {"uuid": "297c2cef-6520-4ec1-bbb0-101228fbfb7e", "title": "Array.prototype.flatMap()", "url": "/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": [], "summary": "O m\u00e9todo <strong><code>flatMap()</code></strong> primeiro mapeia cada elemento usando uma fun\u00e7\u00e3o de mapeamento e, em seguida, nivela o resultado em uma nova array. \u00c9 id\u00eantico a um <code>map</code>\u00a0seguido por um <code>flat</code>\u00a0de profundidade 1, mas <strong><code>flatMap</code></strong> \u00e9 bastante \u00fatil e mesclar ambos em um m\u00e9todo um pouco mais eficiente.{{EmbedInteractiveExample(\"pages/js/array-flatmap.html\")}}", "localization_tags": ["inprogress"], "locale": "pt-BR", "last_edit": "2018-09-07T13:13:25.581417", "review_tags": []}, {"uuid": "bff9d7df-959f-46a9-ae5d-0259669b3a1d", "title": "Array.prototype.flatMap()", "url": "/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap", "tags": [], "summary": "<code><font face=\"Verdana, arial, x-locale-body, sans-serif\"><span style=\"background-color: #ffffff;\">\u041c\u0435\u0442\u043e\u0434\u00a0</span></font><strong>flatMap()</strong></code>\u00a0\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b\u0439\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u043b\u043e\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0432\u00a0\u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432. \u042d\u0442\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u00a0<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a>\u00a0\u0444\u0443\u043a\u043d\u0446\u0438\u0438, \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0<a href=\"https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\">flat</a>\u00a0\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c depth ( \u0433\u043b\u0443\u0431\u0438\u043d\u0430 )\u00a0\u0440\u0430\u0432\u043d\u044b\u043c 1, \u043d\u043e\u00a0<code>flatMap</code>\u00a0\u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e.", "localization_tags": [], "locale": "ru", "last_edit": "2019-02-04T07:23:12.960305", "review_tags": ["editorial"]}], "modified": "2019-02-06T03:04:25.189061", "label": "Array.prototype.flatMap()", "localization_tags": [], "locale": "zh-CN", "id": 228046, "last_edit": "2019-02-06T03:04:23.180984", "summary": "<code><strong>flatMap()</strong></code>\u00a0\u65b9\u6cd5\u9996\u5148\u4f7f\u7528\u6620\u5c04\u51fd\u6570\u6620\u5c04\u6bcf\u4e2a\u5143\u7d20\uff0c\u7136\u540e\u5c06\u7ed3\u679c\u538b\u7f29\u6210\u4e00\u4e2a\u65b0\u6570\u7ec4\u3002\u5b83\u4e0e <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\">map</a>\u00a0\u548c \u6df1\u5ea6\u503c1\u7684\u00a0<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat\">flat</a>\u00a0\u51e0\u4e4e\u76f8\u540c\uff0c\u4f46\u00a0<code>flatMap</code> \u901a\u5e38\u5728\u5408\u5e76\u6210\u4e00\u79cd\u65b9\u6cd5\u7684\u6548\u7387\u7a0d\u5fae\u9ad8\u4e00\u4e9b\u3002", "sections": [{"id": "Quick_Links", "title": null}, {"id": "\u8bed\u6cd5", "title": "\u8bed\u6cd5"}, {"id": "\u53c2\u6570", "title": "\u53c2\u6570"}, {"id": "\u8fd4\u56de\u503c", "title": "\u8fd4\u56de\u503c"}, {"id": "\u63cf\u8ff0", "title": "\u63cf\u8ff0"}, {"id": "\u793a\u4f8b", "title": "\u793a\u4f8b"}, {"id": "Map_\u4e0e_flatMap", "title": null}, {"id": "\u7b49\u4ef7\u64cd\u4f5c", "title": "\u7b49\u4ef7\u64cd\u4f5c"}, {"id": "\u5f52\u7eb3\uff08reduce\uff09_\u4e0e_\u5408\u5e76\uff08concat\uff09", "title": "\u5f52\u7eb3\uff08"}, {"id": "\u89c4\u8303", "title": "\u89c4\u8303"}, {"id": "\u6d4f\u89c8\u5668\u517c\u5bb9\u6027", "title": "\u6d4f\u89c8\u5668\u517c\u5bb9\u6027"}, {"id": "sect1", "title": null}, {"id": "Legend", "title": "Legend"}, {"id": "\u53c2\u89c1", "title": "\u53c2\u89c1"}], "slug": "Web/JavaScript/Reference/Global_Objects/Array/flatMap", "review_tags": []}