[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Int8Array [Back]  [Original]

Int8Array - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Int8Array

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

Int8Array 2 8 . 0 . (, ) .

In this article

Int8Array()

Int8Array .

TypedArray .

Int8Array.BYTES_PER_ELEMENT

. Int8Array 1..

Int8Array.name

. Int8Array "Int8Array" ..

TypedArray .

TypedArray .

Int8Array.prototype.BYTES_PER_ELEMENT

. Int8Array 1 .

TypedArray .

Int8Array

js
//  
const int8 = new Int8Array(2);
int8[0] = 42;
console.log(int8[0]); // 42
console.log(int8.length); // 2
console.log(int8.BYTES_PER_ELEMENT); // 1

//  
const x = new Int8Array([21, 31]);
console.log(x[1]); // 31

//  TypedArray 
const y = new Int8Array(x);
console.log(y[0]); // 21

// ArrayBuffer 
const buffer = new ArrayBuffer(8);
const z = new Int8Array(buffer, 1, 4);
console.log(z.byteOffset); // 1

//  
const iterable = (function* () {
  yield* [1, 2, 3];
})();
const int8FromIterable = new Int8Array(iterable);
console.log(int8FromIterable);
// Int8Array [1, 2, 3]

Specification
ECMAScript 2027 LanguageSpecification
# sec-typedarray-objects


Web Proxy Viewer  |  New URL  |  Original Page