TypedArray.name
The TypedArray.name
static data property represents a string value of the typed array constructor name.
Try it
Value
A string whose value depends on the type of TypedArray
.
Property attributes of TypedArray.name |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Description
TypedArray
objects differ from each other in the number of bytes per element and in the way the bytes are interpreted. The name
property describes what data type the array consists of. It has three parts:
- The first part can be
Int
for integer,Uint
for unsigned integer, orFloat
for floating point. - The second part is a number describing the bit size of each element. Since 64-bit integers are too large to be represented without loss of precision with JavaScript numbers, the elements are stored as
BigInt
values instead, and the first part is prefixed with "Big", becoming eitherBigInt
orBigUint
. - Finally, the name terminates with
Array
orClampedArray
.Uint8ClampedArray
has details about clamped arrays.
Examples
Using name
Int8Array.name; // "Int8Array"
Uint8Array.name; // "Uint8Array"
Uint8ClampedArray.name; // "Uint8ClampedArray"
Int16Array.name; // "Int16Array"
Uint16Array.name; // "Uint16Array"
Int32Array.name; // "Int32Array"
Uint32Array.name; // "Uint32Array"
Float32Array.name; // "Float32Array"
Float64Array.name; // "Float64Array"
BigInt64Array.name; // "BigInt64Array"
BigUint64Array.name; // "BigUint64Array"
Specifications
Specification |
---|
ECMAScript Language Specification # sec-properties-of-the-typedarray-constructors |
Browser compatibility
BCD tables only load in the browser