Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since январь 2020 г..
Метод flat() экземпляров Array возвращает новый массив, в котором все элементы вложенных подмассивов рекурсивно "подняты" на указанный уровень.
Указывает, на сколько уровней вложенности уменьшается мерность исходного массива. По умолчанию 1.
Новый массив с объединёнными в него подмассивами.
Метод flat() удаляет пустые слоты в массивах:
| ECMAScript® 2027 Language Specification # sec-array.prototype.flat |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 18 авг. 2024 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.