Float16Array
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:26
A typed array of 16-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised.
Type Parameters
Section titled “Type Parameters”Type Parameter | Default type |
---|---|
TArrayBuffer extends ArrayBufferLike | ArrayBufferLike |
Indexable
Section titled “Indexable”[index: number]: number
Properties
Section titled “Properties”[toStringTag]
Section titled “[toStringTag]”readonly [toStringTag]: "Float16Array";
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:369
buffer
Section titled “buffer”readonly buffer: TArrayBuffer;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:35
The ArrayBuffer instance referenced by the array.
byteLength
Section titled “byteLength”readonly byteLength: number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:40
The length in bytes of the array.
byteOffset
Section titled “byteOffset”readonly byteOffset: number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:45
The offset in bytes of the array.
BYTES_PER_ELEMENT
Section titled “BYTES_PER_ELEMENT”readonly BYTES_PER_ELEMENT: number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:30
The size in bytes of each element in the array.
length
Section titled “length”readonly length: number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:201
The length of the array.
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”iterator: ArrayIterator<number>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:352
Returns
Section titled “Returns”ArrayIterator
<number
>
at(index): undefined | number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:51
Returns the item located at the specified index.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
index | number | The zero-based index of the desired code unit. A negative index will count back from the last item. |
Returns
Section titled “Returns”undefined
| number
copyWithin()
Section titled “copyWithin()”copyWithin( target, start, end?): this;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:62
Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
target | number | If target is negative, it is treated as length+target where length is the length of the array. |
start | number | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. |
end? | number | If not specified, length of the this object is used as its default value. |
Returns
Section titled “Returns”this
entries()
Section titled “entries()”entries(): ArrayIterator<[number, number]>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:357
Returns an array of key, value pairs for every entry in the array
Returns
Section titled “Returns”ArrayIterator
<[number
, number
]>
every()
Section titled “every()”every(predicate, thisArg?): boolean;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:72
Determines whether all the members of an array satisfy the specified test.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , array ) => unknown | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. |
thisArg? | any | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
Returns
Section titled “Returns”boolean
fill()
Section titled “fill()”fill( value, start?, end?): this;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:82
Changes all array elements from start
to end
index to a static value
and returns the modified array
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
value | number | value to fill array section with |
start? | number | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. |
end? | number | index to stop filling the array at. If end is negative, it is treated as length+end. |
Returns
Section titled “Returns”this
filter()
Section titled “filter()”filter(predicate, thisArg?): Float16Array<ArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:91
Returns the elements of an array that meet the condition specified in a callback function.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , array ) => any | A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. |
thisArg? | any | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
Returns
Section titled “Returns”Float16Array
<ArrayBuffer
>
find()
Section titled “find()”find(predicate, thisArg?): undefined | number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:102
Returns the value of the first element in the array where predicate is true, and undefined otherwise.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , obj ) => boolean | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. |
thisArg? | any | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
Returns
Section titled “Returns”undefined
| number
findIndex()
Section titled “findIndex()”findIndex(predicate, thisArg?): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:113
Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , obj ) => boolean | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. |
thisArg? | any | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
Returns
Section titled “Returns”number
findLast()
Section titled “findLast()”Call Signature
Section titled “Call Signature”findLast<S>(predicate, thisArg?): undefined | S;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:124
Returns the value of the last element in the array where predicate is true, and undefined otherwise.
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
S extends number |
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , array ) => value is S | findLast calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLast immediately returns that element value. Otherwise, findLast returns undefined. |
thisArg? | any | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
Returns
Section titled “Returns”undefined
| S
Call Signature
Section titled “Call Signature”findLast(predicate, thisArg?): undefined | number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:132
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
predicate | (value , index , array ) => unknown |
thisArg? | any |
Returns
Section titled “Returns”undefined
| number
findLastIndex()
Section titled “findLastIndex()”findLastIndex(predicate, thisArg?): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:150
Returns the index of the last element in the array where predicate is true, and -1 otherwise.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , array ) => unknown | findLastIndex calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. |
thisArg? | any | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
Returns
Section titled “Returns”number
forEach()
Section titled “forEach()”forEach(callbackfn, thisArg?): void;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:166
Performs the specified action for each element in an array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
callbackfn | (value , index , array ) => void | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. |
thisArg? | any | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
Returns
Section titled “Returns”void
includes()
Section titled “includes()”includes(searchElement, fromIndex?): boolean;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:173
Determines whether an array includes a certain element, returning true or false as appropriate.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
searchElement | number | The element to search for. |
fromIndex? | number | The position in this array at which to begin searching for searchElement. |
Returns
Section titled “Returns”boolean
indexOf()
Section titled “indexOf()”indexOf(searchElement, fromIndex?): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:181
Returns the index of the first occurrence of a value in an array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
searchElement | number | The value to locate in the array. |
fromIndex? | number | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. |
Returns
Section titled “Returns”number
join()
Section titled “join()”join(separator?): string;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:188
Adds all the elements of an array separated by the specified separator string.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
separator? | string | A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. |
Returns
Section titled “Returns”string
keys()
Section titled “keys()”keys(): ArrayIterator<number>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:362
Returns an list of keys in the array
Returns
Section titled “Returns”ArrayIterator
<number
>
lastIndexOf()
Section titled “lastIndexOf()”lastIndexOf(searchElement, fromIndex?): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:196
Returns the index of the last occurrence of a value in an array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
searchElement | number | The value to locate in the array. |
fromIndex? | number | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. |
Returns
Section titled “Returns”number
map(callbackfn, thisArg?): Float16Array<ArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:211
Calls a defined callback function on each element of an array, and returns an array that contains the results.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
callbackfn | (value , index , array ) => number | A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. |
thisArg? | any | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
Returns
Section titled “Returns”Float16Array
<ArrayBuffer
>
reduce()
Section titled “reduce()”Call Signature
Section titled “Call Signature”reduce(callbackfn): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:223
Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
callbackfn | (previousValue , currentValue , currentIndex , array ) => number | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. |
Returns
Section titled “Returns”number
Call Signature
Section titled “Call Signature”reduce(callbackfn, initialValue): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:224
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
callbackfn | (previousValue , currentValue , currentIndex , array ) => number |
initialValue | number |
Returns
Section titled “Returns”number
Call Signature
Section titled “Call Signature”reduce<U>(callbackfn, initialValue): U;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:236
Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
U |
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
callbackfn | (previousValue , currentValue , currentIndex , array ) => U | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. |
initialValue | U | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
Returns
Section titled “Returns”U
reduceRight()
Section titled “reduceRight()”Call Signature
Section titled “Call Signature”reduceRight(callbackfn): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:248
Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
callbackfn | (previousValue , currentValue , currentIndex , array ) => number | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. |
Returns
Section titled “Returns”number
Call Signature
Section titled “Call Signature”reduceRight(callbackfn, initialValue): number;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:249
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
callbackfn | (previousValue , currentValue , currentIndex , array ) => number |
initialValue | number |
Returns
Section titled “Returns”number
Call Signature
Section titled “Call Signature”reduceRight<U>(callbackfn, initialValue): U;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:261
Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
U |
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
callbackfn | (previousValue , currentValue , currentIndex , array ) => U | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. |
initialValue | U | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
Returns
Section titled “Returns”U
reverse()
Section titled “reverse()”reverse(): this;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:266
Reverses the elements in an Array.
Returns
Section titled “Returns”this
set(array, offset?): void;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:273
Sets a value or an array of values.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
array | ArrayLike <number > | A typed or untyped array of values to set. |
offset? | number | The index in the current array at which the values are to be written. |
Returns
Section titled “Returns”void
slice()
Section titled “slice()”slice(start?, end?): Float16Array<ArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:280
Returns a section of an array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
start? | number | The beginning of the specified portion of the array. |
end? | number | The end of the specified portion of the array. This is exclusive of the element at the index ‘end’. |
Returns
Section titled “Returns”Float16Array
<ArrayBuffer
>
some()
Section titled “some()”some(predicate, thisArg?): boolean;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:290
Determines whether the specified callback function returns true for any element of an array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
predicate | (value , index , array ) => unknown | A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. |
thisArg? | any | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
Returns
Section titled “Returns”boolean
sort()
Section titled “sort()”sort(compareFn?): this;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:301
Sorts an array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
compareFn? | (a , b ) => number | Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they’re equal and a positive value otherwise. If omitted, the elements are sorted in ascending order. [11,2,22,1].sort((a, b) => a - b) |
Returns
Section titled “Returns”this
subarray()
Section titled “subarray()”subarray(begin?, end?): Float16Array<TArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:309
Gets a new Float16Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
begin? | number | The index of the beginning of the array. |
end? | number | The index of the end of the array. |
Returns
Section titled “Returns”Float16Array
<TArrayBuffer
>
toLocaleString()
Section titled “toLocaleString()”toLocaleString(locales?, options?): string;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:314
Converts a number to a string by using the current locale.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
locales? | string | string [] |
options? | NumberFormatOptions |
Returns
Section titled “Returns”string
toReversed()
Section titled “toReversed()”toReversed(): Float16Array<ArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:319
Copies the array and returns the copy with the elements in reverse order.
Returns
Section titled “Returns”Float16Array
<ArrayBuffer
>
toSorted()
Section titled “toSorted()”toSorted(compareFn?): Float16Array<ArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:331
Copies and sorts the array.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
compareFn? | (a , b ) => number | Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they’re equal, and a positive value otherwise. If omitted, the elements are sorted in ascending order. const myNums = Float16Array.from([11.25, 2, -22.5, 1]); myNums.toSorted((a, b) => a - b) // Float16Array(4) [-22.5, 1, 2, 11.5] |
Returns
Section titled “Returns”Float16Array
<ArrayBuffer
>
toString()
Section titled “toString()”toString(): string;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:336
Returns a string representation of an array.
Returns
Section titled “Returns”string
valueOf()
Section titled “valueOf()”valueOf(): this;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:339
Returns the primitive value of the specified object.
Returns
Section titled “Returns”this
values()
Section titled “values()”values(): ArrayIterator<number>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:367
Returns an list of values in the array
Returns
Section titled “Returns”ArrayIterator
<number
>
with()
Section titled “with()”with(index, value): Float16Array<ArrayBuffer>;
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.float16.d.ts:348
Copies the array and inserts the given number at the provided index.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
index | number | The index of the value to overwrite. If the index is negative, then it replaces from the end of the array. |
value | number | The value to insert into the copied array. |
Returns
Section titled “Returns”Float16Array
<ArrayBuffer
>
A copy of the original array with the inserted value.