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년 7월.
Array 인스턴스의 keys() 메서드는 배열의 각 인덱스에 대한 키를 포함하는 새로운 배열 반복자 객체를 반환합니다.
없음.
새로운 순회 가능 반복자 객체
희소 배열에 사용되는 경우, keys() 메서드는 빈 슬롯의 값이 undefined인 것처럼 반복합니다.
key() 메서드는 범용 메서드입니다. 본 메서드는 this 값에 length 속성과 정수 키 속성만을 기대합니다.
배열에 실제로 존재하는 키만 포함하는 Object.keys()와 달리, keys() 반복자는 누락된 속성을 나타내는 빈 공간을 무시하지 않습니다.
keys() 메서드는 this의 length 속성을 읽은 다음, 0과 length - 1 사이의 모든 정수 인덱스를 산출합니다. 실제 인덱스 접근은 발생하지 않습니다.
| ECMAScript® 2027 Language Specification # sec-array.prototype.keys |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 10월 10일 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.