--- title: ArrayBuffer.prototype slug: conflicting/Web/JavaScript/Reference/Global_Objects/ArrayBuffer translation_of: Web/JavaScript/Reference/Global_Objects/ArrayBuffer translation_of_original: Web/JavaScript/Reference/Global_Objects/ArrayBuffer/prototype original_slug: Web/JavaScript/Reference/Global_Objects/ArrayBuffer/prototype ---
{{JSRef}}

The ArrayBuffer.prototype property represents the prototype for the {{jsxref("ArrayBuffer")}} object.

{{js_property_attributes(0,0,0)}}

描述

ArrayBuffer instances inherit from ArrayBuffer.prototype. As with all constructors, you can change the constructor's prototype object to make changes to all ArrayBuffer instances.

屬性

ArrayBuffer.prototype.constructor
Specifies the function that creates an object's prototype. The initial value is the standard built-in ArrayBuffer constructor.
{{jsxref("ArrayBuffer.prototype.byteLength")}} {{readonlyInline}}
陣列大小,以位元組(byte)計算。此屬性在陣列建立之後就不可能改變了。唯讀

方法

{{jsxref("ArrayBuffer.prototype.slice()")}}
Returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from begin, inclusive, up to end, exclusive. If either begin or end is negative, it refers to an index from the end of the array, as opposed to from the beginning.

規範

Specification Status Comment
{{SpecName('ES6', '#sec-arraybuffer.prototype', 'ArrayBuffer.prototype')}} {{Spec2('ES6')}} Initial definition.
{{SpecName('ESDraft', '#sec-arraybuffer.prototype', 'ArrayBuffer.prototype')}} {{Spec2('ESDraft')}}  

瀏覽器相容性

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 7.0 {{ CompatGeckoDesktop("2")}} 10 11.6 5.1
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 4.0 {{CompatVersionUnknown}} {{CompatGeckoMobile("2")}} 10 11.6 4.2

參見