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 2016년 9월.
Map 객체의 @@iterator 메서드는 반복가능 프로토콜을 구현하여 전개 구문와 for...of 루프같은 반복이 필요한 대부분의 구문에서 맵을 사용할 수 있게 합니다. 맵의 키-값 쌍을 생성하는 반복자를 반환합니다.
이 속성의 초기 값은 Map.prototype.entries 속성의 초기 값과 동일한 함수 객체입니다.
Map.prototype.entries()과 동일한 반환 값을 반환합니다. 이는 맵의 키-값 쌍을 생성하는 새로운 반복자 객체입니다.
이 메서드를 직접 호출할 필요는 거의 없다는 점을 명심하시기 바랍니다. @@iterator 메서드의 존재는 Map 객체를 반복 가능하게 만들고, for...of 루프와 같은 반복 구문이 자동으로 이 메서드를 호출하여 루프를 도는 반복자를 얻기 위함입니다.
반복 프로세스를 최대로 제어하기 위해 반환된 반복자 객체의 next() 메서드를 수동으로 호출할 수도 있습니다.
| ECMAScript® 2027 Language Specification # sec-map.prototype-%symbol.iterator% |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 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.