JavaScript TypedArray
Types of TypedArray
Int8Array
- Size in bytes: 1
- Description: 8-bit two's compliment signed integer.
- Type: byte.
- Value Range: -128 to 127
Unit8Array
- Size in bytes: 1
- Description: 8-bit two's compliment signed octet.
- Type: octet.
- Value Range: 0 to 255.
Unit8ClampedArray
- Size in bytes: 1
- Description: 8-bit unsigned integer (clamped) octet.
- Type: octet.
- Value Range: 0 to 255.
Int16Array
- Size in bytes: 2
- Description: 16-bit two's complement signed integer.
- Type: short.
- Value Range: -32768 to 32767.
Unit16Array
- Size in bytes: 2
- Description: 16-bit unsigned integer.
- Type: unsigned short.
- Value Range: 0 to 65535.
Int32Array
- Size in bytes: 4
- Description: 32-bit two's complement signed integer.
- Type: long.
- Value Range: -2147483648 to 2147483647.
Uint32Array
- Size in bytes: 4
- Description: 32-bit unsigned integer.
- Type: unsigned long.
- Value Range: 0 to 4294967295
Float32Array
- Size in bytes: 4
- Description: 32-bit IEEE floating point number unrestricted float.
- Type: unrestricted float.
- Value Range: 1.2x10-38 to 3.4x1038
Float64Array
- Size in bytes: 8
- Description: 64-bit IEEE floating point number unrestricted double.
- Type: unrestricted double.
- Value Range: 5.0x10-324 to 1.8x10308
JavaScript TypedArray Methods
Let's see the list of JavaScript
TypedArray methods with their description.
Methods | Description |
---|---|
copyWithin() | The copyWithin () method copies a portion of an array to another location in the same array and returns the size without modification. |
entries() | The JavaScript entries() method returns a new Array Iterator object that contains key/value pairs for each index in the array. |
every() | javaScript Array.every() method test whether all the elements of the array satisfy the given condition or not. |
fill() | The javaScript fill() method is used to fill all the elements of array from a start index to an end index with a static value. |
Filter() | The JavaScript Array filter() method form a new array that fall under a given criteria from an existing array. |
find() | The JavaScript find() Method is used to get the value of the first element in the array that satisfies the provided condition. |
findIndex() | The JavaScript findIndex() method is provide the index of the element that complete the given test in the array. |
forEach() | The JavaScript forEach() method calls the provided function once for each element of the array. |
includes() | The JavaScript Array includes() method is inbuilt function in JavaScript which is used to determines whether a particular element is present in the array or not. |
indexof() | The JavaScript indexof() Method is used to find the index of the element provided as the argument to the function. |
join() | The JavaScript join() method is used to join all elements of an Array into a string. |
Keys() | The JavaScript Keys() method is an inbuilt function in JavaScript. This method returns an Array Iterator object with the keys of an array. |
lastIndexof() | The javaScript lastIndex()of method returns the last position of a value, or it return -1 if the value is not found. |
map() | The JavaScript map() method form a new array with the result of calling a function for every element. |
reduce() | The JavaScript reduce() method reduce the elements of an array into a single value. |
reduceRight() | The JavaScript reduceRight() method reduce the elements of an array into a single value. |
reverse() | The JavaScript reverse() method is used to reverse the array. |
set() | The JavaScript set() method is used to store values into the given array. |
Slice() | The JavaScript slice() method gives the selected elements of the array on which is implemented. |
some() | JavaScript some() method examine the elements of the array that satisfies the given condition or not. |
sort() | The JavaScript sort() method is used to sort the array and returns the updated array. |
subarray() | The JavaScript subarray() method returns a new array and it does not change the original array. |
values() | The JavaScript values() method is used to define the value of the contents in the array |
toLocaleString() | The JavaScript toLocaleString() method is used to convert the element of the given array into a string. |
toString() | The JavaScript toString() method is used to convert the element of the given array into a string. And these Strings are separated by such as a comma ",". |
Comments