TypedArray의 values() 함수는 형식화된 배열의 값을 보유하는 반복기 객체를 반환합니다. next() 메서드는 반복자 객체의 다음 요소를 반환합니다.
구문
구문은 다음과 같습니다.
typedArray.values()
예시
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);
var iterator = typedArray.values();
document.write("Contents of the typed array: ");
for(i=0; i<typedArray.length; i++) {
document.writeln(iterator.next().value);
}
</script>
</body>
</html> 출력
Contents of the typed array: 11 5 13 4 15 3 17 2 19 8