TypedArray 객체의 set() 함수는 배열에 인덱스를 나타내는 숫자를 받아서 지정된 배열의 내용을 주어진 인덱스에서 시작하여 현재 배열에 복사합니다.
구문
구문은 다음과 같습니다.
typedArray.set()
예시
<html>
<head>
<title>JavaScript Array every Method</title>
</head>
<body>
<script type="text/javascript">
var typedArray1 = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);
document.write("Contents of the typed array: "+typedArray1);
document.write("<br>");
var typedArray2 = new Int32Array([110, 215, 316, 916, 616, 117, 311 ]);
typedArray1.set(typedArray2, 3);
document.write("Result: "+typedArray1);
</script>
</body>
</html> 출력
Contents of the typed array: 11,5,13,4,15,3,17,2,19,8 Result: 11,5,13,110,215,316,916,616,117,311