Available in Chrome 45+ | View on GitHub | Browse Samples
ECMAScript 2015
specification adds additional static methods on TypedArray
subclasses (Int8Array, Float32Array, ...) and instance
methods on their prototype that mirror most Array.prototype
methods.
The TypedArray.from() method creates a new way to make
TypedArrays based on existing iterable or Array-like objects,
analogous to Array.from.
Uint8Array.from(new Set([1, 1, 2, 3])); // [1, 2, 3]
Uint8Array.from('hello'); // [0, 0, 0, 0, 0]
Uint8Array.from('hello', x => x.charCodeAt(0)); // [104, 101, 108, 108, 111]
The TypedArray.of() method is almost the same as Array.of().
Uint8Array.of(1, 2, 3, 256 + 4); // [1, 2, 3, 4]Array.prototype instance methodsTypedArray.prototype.copyWithinTypedArray.prototype.everyTypedArray.prototype.fillTypedArray.prototype.filterTypedArray.prototype.findTypedArray.prototype.findIndexTypedArray.prototype.forEachTypedArray.prototype.indexOfTypedArray.prototype.joinTypedArray.prototype.lastIndexOfTypedArray.prototype.mapTypedArray.prototype.reduceTypedArray.prototype.reduceRightTypedArray.prototype.reverseTypedArray.prototype.someTypedArray.prototype.sortTypedArray.prototype.toLocaleStringTypedArray.prototype.toString