JS prototype 属性的总结
**TypedArray**
**.prototype
**属性表示TypedArray
构造器的原型.
TypedArray.prototype 属性的属性特性: |
---|
writable |
enumerable |
configurable |
描述
TypedArray
实例继承自 TypedArray.prototype
. 你可以通过该原型对象为所有的类型化数组(typed array types)实例添加属性和方法.
关于继承的更多的信息请参见关于TypedArray 的描述.
属性
TypedArray.prototype.constructor
返回创建实例原型的构造函数.这是相应的typed array type的默认的构造函数.
TypedArray.prototype.buffer
只读
返回被格式化数组引用的ArrayBuffer
. 创建时已被固化,因此是只读的.
TypedArray.prototype.byteLength
只读
返回从ArrayBuffer
读取的字节长度. 创建时已被固化,因此是只读的.
TypedArray.prototype.byteOffset
只读
返回从ArrayBuffer
读取时的字节偏移量**.**创建时已被固化,因此是只读的.
TypedArray.prototype.length
只读
返回在类型化数组中的元素的数量**.**创建时已被固化,因此是只读的.
methods
- TypedArray
- TypedArray
- BYTES_PER_ELEMENT
- length
- name
- prototype
- buffer
- byteLength
- byteOffset
- from()
- of()
- copyWithin()
- entries()
- every()
- fill()
- filter()
- find()
- findIndex()
- forEach()
- includes()
- indexOf()
- join()
- keys()
- lastIndexOf()
- map()
- move()
- reduce()
- reduceRight()
- reverse()
- set()
- slice()
- some()
- sort()
- subarray()
- toLocaleString()
- toString()
- values()
- arr[Symbol.iterator]()
- Int8Array
- Uint8Array
- Uint8ClampedArray
- Int16Array
- Uint16Array
- Int32Array
- Uint32Array
- Float32Array
- Float64Array
返回一个包含数组中每个元素的新的数组迭代对象.
规范
规范 | 状态 | 备注 |
---|---|---|
[ECMAScript 2015 (6th Edition, ECMA-262) | ||
TypedArray prototype](https://www.ecma-international.org/ecma-262/6.0/#sec-properties-of-the-%typedarrayprototype%-object) | Standard | Initial definition. |
[ECMAScript Latest Draft (ECMA-262) | ||
TypedArray prototype](https://tc39.github.io/ecma262/#sec-properties-of-the-%typedarrayprototype%-object) | Draft |
浏览器兼容
We’re converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven’t yet converted the data it contains.
- Desktop
- Mobile
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 7.0 | 4.0 (2) | 10 | 11.6 | 5.1 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 4.0 | (Yes) | 4.0 (2) | 10 | 11.6 | 4.2 |