JavaScript typedArray.@@species with Example
The typedArray.@@species is an inbuilt property in JavaScript that is used to return the constructor of the given typedArray.
The typedArray is of many types like:
Syntax:
typedArray[Symbol.species]
Parameters: It does not accept any parameter because it is a property not a function.
Return value: It returns the constructor of the given typedArray.
Example:
javascript
a = Int8Array[Symbol.species];
b = Uint8Array[Symbol.species];
c = Uint8ClampedArray[Symbol.species];
d = Int16Array[Symbol.species];
e = Uint16Array[Symbol.species];
f = Int32Array[Symbol.species];
g = Uint32Array[Symbol.species];
h = Float32Array[Symbol.species];
i = Float64Array[Symbol.species];
console.log(a);
console.log(b);
console.log(c);
console.log(d);
console.log(e);
console.log(f);
console.log(g);
console.log(h);
console.log(i);
|
Output:
function Int8Array() { [native code] }
function Uint8Array() { [native code] }
function Uint8ClampedArray() { [native code] }
function Int16Array() { [native code] }
function Uint16Array() { [native code] }
function Int32Array() { [native code] }
function Uint32Array() { [native code] }
function Float32Array() { [native code] }
function Float64Array() { [native code] }
Last Updated :
15 Feb, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...