Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Promise.all 또는 TypedArray.from 과 같은 함수의 아규먼트 또는 for…of 의 right hand-side 로 주어진 값이 iterable 객체가 아닙니다. iterable 은 Array, String 또는 Map, 생성자 결과, 또는 iterable protocol 구현 객체와 같은 내장 iterable 타입이 될 수 있습니다.
JavaScript 에서 iterable protocol 을 구현하지 않은 Object 는 iterable 이 아닙니다. 그러므로, 객체의 프로퍼티를 반복하기 위해 for…of 를 사용하면 안됩니다.
객체의 모든 항목 또는 프로퍼티를 반복하려면 대신 Object.keys 또는 Object.entries 를 사용해야 합니다.
이 유즈 케이스에 대한 다른 옵션은 Map 을 사용하는 것입니다.
Generators 는 iterable 객체를 생성하기 위해 호출하는 함수입니다.
generator 가 호출되지 않으면, generator 에 해당하는 Function 객체를 호출할수는 있지만 interable 하지는 않습니다. generator 호출은 generator 실행동안 yield 된 모든 값을 iterate 하는 iterable 객체를 생성합니다.
This page was last modified on 2024년 12월 17일 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.