Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

TypedArray.prototype[@@iterator]()

@@iterator 속성의 초기값은 values 속성의 초기값과 같은 함수 객체입니다.

구문

arr[Symbol.iterator]()

for...of 루프를 사용하는 반복

var arr = new Uint8Array([10, 20, 30, 40, 50]);
// 브라우저가 for..of 루프 및 for 루프에서
// let 스코프인 변수를 지원해야 합니다
for (let n of arr) {
  console.log(n);
}

대안 반복

var arr = new Uint8Array([10, 20, 30, 40, 50]);
var eArr = arr[Symbol.iterator]();
console.log(eArr.next().value); // 10
console.log(eArr.next().value); // 20
console.log(eArr.next().value); // 30
console.log(eArr.next().value); // 40
console.log(eArr.next().value); // 50

스펙

스펙 상태 설명
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of '%TypedArray%.prototype[@@iterator]()' in that specification.
Standard 초기 정의.
ECMAScript 2017 Draft (ECMA-262)
The definition of '%TypedArray%.prototype[@@iterator]()' in that specification.
Draft  

브라우저 호환성

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 36 (36) [1] No support No support No support
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support (Yes) 36.0 (36) [1] No support No support No support

[1] Gecko 17 (Firefox 17 / Thunderbird 17 / SeaMonkey 2.14)에서 Gecko 26 (Firefox 26 / Thunderbird 26 / SeaMonkey 2.23 / Firefox OS 1.2)까지는 iterator 속성이 쓰였고(bug 907077), Gecko 27에서 Gecko 35까지는 "@@iterator" placeholder가 사용됐습니다. Gecko 36 (Firefox 36 / Thunderbird 36 / SeaMonkey 2.33)에서는, @@iterator symbol이 구현됐습니다 (bug 918828).

참조

문서 태그 및 공헌자

 이 페이지의 공헌자: Netaras
 최종 변경: Netaras,