| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/TypedArray | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
// Create a TypedArray with a size in bytes
const typedArray1 = new Int8Array(8);
typedArray1[0] = 32;
const typedArray2 = new Int8Array(typedArray1);
typedArray2[1] = 42;
console.log(typedArray1);
// Expected output: Int8Array [32, 0, 0, 0, 0, 0, 0, 0]
console.log(typedArray2);
// Expected output: Int8Array [32, 42, 0, 0, 0, 0, 0, 0]
TypedArray TypedArray [[Prototype]] .
%TypedArray% TypedArray . Object.getPrototypeOf(Int8Array) . TypedArrays %TypedArray% , (TypedArray.prototype) %TypedArray%.prototype [[Prototype]] .
TypedArray(: Int8Array) ArrayBuffer . %TypedArray%.prototype (: ) .
| Web IDL | C | ||||
|---|---|---|---|---|---|
Int8Array |
-128 to 127 | 1 | 8 2 | byte |
int8_t |
Uint8Array |
0 to 255 | 1 | 8 | octet |
uint8_t |
Uint8ClampedArray |
0 to 255 | 1 | 8 () | octet |
uint8_t |
Int16Array |
-32768 to 32767 | 2 | 16 2 | short |
int16_t |
Uint16Array |
0 to 65535 | 2 | 16 | unsigned short |
uint16_t |
Int32Array |
-2147483648 to 2147483647 | 4 | 32 2 | long |
int32_t |
Uint32Array |
0 to 4294967295 | 4 | 32 | unsigned long |
uint32_t |
Float32Array |
-3.4E38 3.4E38. 1.2E-38 |
4 | 32 IEEE ( 7 , : 1.234567) |
unrestricted float |
float |
Float64Array |
-1.8E308 1.8E308. 5E-324 |
8 | 64 IEEE ( 16 , : 1.23456789012345) |
unrestricted double |
double |
BigInt64Array |
-263 263 - 1 | 8 | 64 2 | bigint |
int64_t (signed long long) |
BigUint64Array |
0 264 - 1 | 8 | 64 | bigint |
uint64_t (unsigned long long) |
. Int8Array BigInt64Array . .
new TypedArray();
new TypedArray(length);
new TypedArray(typedArray);
new TypedArray(object);
new TypedArray(buffer);
new TypedArray(buffer, byteOffset);
new TypedArray(buffer, byteOffset, length);
TypedArray .
lengthlength , length BYTES_PER_ELEMENT 0 .
typedArraytypedArray , typedArray . non-bigint TypedArray , typedArray non-bigint (: Int32Array) . bigint TypedArray , typedArray bigint (: BigInt64Array) . typedArray . typedArray .
objectobject , TypedArray.from() .
buffer, byteOffset,
lengthbuffer byteOffset length , ArrayBuffer . byteOffset length . , length buffer .
TypeArray . .
TypeError.
typedArray , bigint .typeArray , buffer .RangeError.
buffer (length ) byteOffset .byteOffset (0 253 - 1 ) .byteOffset + length * TypedArray.BYTES_PER_ELEMENT > buffer.byteLength.TypedArray.BYTES_PER_ELEMENTTypedArray .
TypedArray.name (: "Int8Array").
get TypedArray[@@species].
TypedArrayTypedArray .
TypedArray.from() TypedArray . Array.from() .
TypedArray.of() TypedArray . Array.of() .
TypedArray.prototype.buffer ArrayBuffer . .
TypedArray.prototype.byteLength() . .
TypedArray.prototype.byteOffsetArrayBuffer () . .
TypedArray.prototype.length. .
TypedArray.prototype.at(). .
TypedArray.prototype.copyWithin()TypedArray.prototype.entries()TypedArray.prototype.every()TypedArray.prototype.fill()TypedArray.prototype.filter() true . Array.prototype.filter() .
TypedArray.prototype.find() element , undefined . Array.prototype.find() .
TypedArray.prototype.findIndex() , -1 . Array.prototype.findIndex() .
TypedArray.prototype.findLast() , undefined . Array.prototype.findLast() .
TypedArray.prototype.findLastIndex() , -1 . Array.prototype.findLastIndex() ..
TypedArray.prototype.forEach()TypedArray.prototype.includes() true false Array.prototype.includes() .
TypedArray.prototype.indexOf() () , -1 . Array.prototype.indexOf() .
TypedArray.prototype.join()TypedArray.prototype.keys()TypedArray.prototype.lastIndexOf() ( ) , -1 . Array.prototype.lastIndexOf() ..
TypedArray.prototype.map()TypedArray.prototype.reduce() ( ) . Array.prototype.reduce() .
TypedArray.prototype.reduceRight() ( ) . Array.prototype.reduceRight() .
TypedArray.prototype.reverse()TypedArray.prototype.set().
TypedArray.prototype.slice()TypedArray.prototype.some() , true . Array.prototype.some() .
TypedArray.prototype.sort()TypedArray.prototype.subarray() TypedArray .
TypedArray.prototype.values()TypedArray.prototype.toLocaleString()TypedArray.prototype.toString()TypedArray.prototype[@@iterator]().
(, ) .
.
ArrayBuffer .
.
//
const int16 = new Int16Array(2);
int16[0] = 42;
console.log(int16[0]); // 42
// (Fx 25)
Int8Array.prototype[20] = "foo";
new Int8Array(32)[20]; // 0
//
Int8Array.prototype[20] = "foo";
new Int8Array(8)[20]; // undefined
//
Int8Array.prototype[-1] = "foo";
new Int8Array(8)[-1]; // undefined
// (Fx 30)
Int8Array.prototype.foo = "bar";
new Int8Array(32).foo; // "bar"
TypedArray . ArrayBuffer TypedArray . .
const i8 = Int8Array.of(1, 2, 3);
Object.freeze(i8);
// TypeError: Cannot freeze array buffer views with elements
TypedArray ArrayBuffer byteOffset . , BYTES_PER_ELEMENT .
const i32 = new Int32Array(new ArrayBuffer(4), 1);
// RangeError: start offset of Int32Array should be a multiple of 4
const i32 = new Int32Array(new ArrayBuffer(4), 0);
byteOffset TypedArray ArrayBuffer byteLength BYTES_PER_ELEMENT .
const i32 = new Int32Array(new ArrayBuffer(3));
// RangeError: byte length of Int32Array should be a multiple of 4
const i32 = new Int32Array(new ArrayBuffer(4));
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-typedarray-objects |
This page was last modified on 2026 7 15 by MDN contributors.
TypedArrayTypedArray.prototype.at()TypedArray.prototype.copyWithin()TypedArray.prototype.entries()TypedArray.prototype.every()TypedArray.prototype.fill()TypedArray.prototype.filter()TypedArray.prototype.find()TypedArray.prototype.findIndex()TypedArray.prototype.findLast()TypedArray.prototype.findLastIndex()TypedArray.prototype.forEach()includes()TypedArray.prototype.indexOf()TypedArray.prototype.join()TypedArray.prototype.keys()lastIndexOf()TypedArray.prototype.map()TypedArray.prototype.reduce()reduceRight()TypedArray.prototype.reverse()TypedArray.prototype.set()TypedArray.prototype.slice()TypedArray.prototype.some()TypedArray.prototype.sort()TypedArray.prototype.subarray()toLocaleString()TypedArray.prototype.toReversed()TypedArray.prototype.toSorted()TypedArray.prototype.toString()TypedArray.prototype.values()TypedArray.prototype.with()TypedArray.prototype[@@iterator]()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()BigInt64ArrayBigUint64ArrayFloat16ArrayFloat32ArrayFloat64ArrayInt8ArrayInt16ArrayInt32ArrayUint8ArrayUint8ClampedArrayUint16ArrayUint32ArrayYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |