// 構文 (1)
var typedArray_1 = new Int32Array();
console.log(typedArray_1.length);
// 出力:0
console.log(typedArray_1);
// 出力:[]
// 構文 (2)
var typedArray_2 = new Int32Array(5);
console.log(typedArray_2.length);
// 出力:5
console.log(typedArray_2);
// 出力:[0, 0, 0, 0, 0]
// 構文 (3)
var typedArray_30 = new Int32Array([ 1, 2, 3 ]);
var typedArray_31 = new Int32Array(typedArray_30);
console.log(typedArray_30 === typedArray_31);
// 出力:false 別のビュー
console.log(typedArray_30.buffer === typedArray_31.buffer);
// 出力:false 別の実体 (コピー)
typedArray_30[0] = 10;
console.log(typedArray_30);
// 出力:[10, 2, 3]
console.log(typedArray_31);
// 出力:[1, 2, 3]
// 構文 (4)
var array = [ 1, 2, 3 ];
var typedArray_4 = new Int32Array(array);
console.log(typedArray_4.length);
// 出力:3
console.log(typedArray_4);
// 出力:[1, 2, 3]
// 構文 (5-1)
var arrayBuffer = new ArrayBuffer(4 * 3);
var typedArray_50 = new Int32Array(arrayBuffer);
var typedArray_51 = new Int32Array(arrayBuffer);
console.log(typedArray_50 === typedArray_51);
// 出力:false 別のビュー
console.log(typedArray_50.buffer === typedArray_51.buffer);
// 出力:true 同一実体
typedArray_50[0] = 10;
console.log(typedArray_50);
// 出力:[10, 0, 0]
console.log(typedArray_51);
// 出力:[10, 0, 0]
// 構文 (5-2)
var typedArray_52 = new Int32Array([ 1, 2, 3 ]);
console.log(typedArray_52.BYTES_PER_ELEMENT);
// 出力:4
// ビューの実体を指定
var typedArray_53 = new Int32Array(typedArray_52.buffer, typedArray_52.BYTES_PER_ELEMENT, 2);
console.log(typedArray_53);
// 出力:[2, 3]
console.log(typedArray_52 === typedArray_53);
// 出力:false 別のビュー
console.log(typedArray_52.buffer === typedArray_53.buffer);
// 出力:true 同一実体
typedArray_53[0] = 20;
console.log(typedArray_53);
// 出力:[20, 3]
console.log(typedArray_52);
// 出力:[1, 20, 3]