values()
메서드는 배열 내 각 인덱스에 대한 값을 포함하는 새로운 Array Iterator
객체를 반환합니다.
구문
arr.values()
예
for...of
루프를 사용한 반복
var arr = new Uint8Array([10, 20, 30, 40, 50]);
var eArray = arr.values();
// 브라우저가 for..of 루프 및 for 루프에서
// let 스코프인 변수를 지원해야 합니다
for (let n of eArray) {
console.log(n);
}
대안 반복
var arr = new Uint8Array([10, 20, 30, 40, 50]);
var eArr = arr.values();
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
스펙
브라우저 호환성
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | 37 (37) | 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) | 37.0 (37) | No support | No support | No support |