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년 9월.
Set 객체의 @@iterator 메서드는 Iteration 프로토콜을 구현하며, 전개 구문 및 for...of 루프와 같이 순회를 예상하는 대부분의 구문에서 Set을 사용할 수 있도록 합니다. Set의 값을 산출하는 반복자를 반환합니다.
이 속성의 초기 값은 Set.prototype.values 속성의 초기 값과 동일한 함수 객체입니다.
Set.prototype.values()와 동일하게 set의 값을 산출하는 새로운 반복 가능한 반복자 객체를 반환합니다.
이 메서드를 직접 호출할 필요는 거의 없습니다. @@iterator 메서드의 존재는 Set 객체가 반복 가능하게 해주며, for...of 루프와 같은 반복 구문은 이 메서드를 자동으로 호출하여 루프를 돌릴 반복자를 얻게 됩니다.
반환된 반복자 객체의 next() 메서드를 수동으로 호출하여 반복 프로세스를 최대한 제어할 수 있습니다.
| ECMAScript® 2027 Language Specification # sec-set.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.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.