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 июль 2015 г..
Метод Array.isArray() возвращает true, если объект является массивом и false, если он массивом не является.
Объект для проверки.
true если объект является Array; иначе, false.
За подробностям обращайтесь к статье «Абсолютно точное определение того, является ли JavaScript-объект массивом или нет».
Когда проверяем экземпляр Array, Array.isArray предпочтительней, чем instanceof, потому что он работает и с iframes.
Выполнение следующего кода перед любым другим кодом создаст метод Array.isArray(), если он ещё не реализован в браузере.
| ECMAScript® 2027 Language Specification # sec-array.isarray |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 17 дек. 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.