Float16Array

open class Float16Array<B : ArrayBufferLike>(val buffer: B, val byteOffset: Int = definedExternally, val length: Int = definedExternally) : TypedArray<Float16Array<B>, Float16Array<ArrayBuffer>, B, JsFloat16> , Serializable(source)

MDN Reference

Constructors

Link copied to clipboard
constructor(buffer: B, byteOffset: Int = definedExternally, length: Int = definedExternally)
constructor()
constructor(length: Int)
constructor(elements: JsIterable<JsFloat16>)
constructor(elements: ReadonlyArray<JsFloat16>)

Types

Link copied to clipboard

Properties

Link copied to clipboard
open external override val buffer: B
Link copied to clipboard
open external override val byteLength: Int
Link copied to clipboard
open external override val byteOffset: Int
Link copied to clipboard
external val BYTES_PER_ELEMENT: Int

The size in bytes of each element in the array.

Link copied to clipboard
open external override val length: Int

Functions

Link copied to clipboard
fun <T : JsAny?> JsIterable<T>.[@@iterator](): JsIterator<T>
Link copied to clipboard
fun <T : JsAny?> ArrayLike<T>.asList(): List<T>
Link copied to clipboard
external fun at(index: Int): JsFloat16?

Returns the item located at the specified index.

Link copied to clipboard
external fun copyWithin(target: Int, start: Int, end: Int = definedExternally): Float16Array<B>

Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

Link copied to clipboard
open external fun entries(): JsIterator<Tuple2<JsInt, JsFloat16>>
Link copied to clipboard
external fun every(predicate: (value: JsFloat16) -> Boolean): Boolean

Determines whether all the members of an array satisfy the specified test.

Link copied to clipboard
external fun fill(value: JsFloat16, start: Int = definedExternally, end: Int = definedExternally): Float16Array<B>

Changes all array elements from start to end index to a static value and returns the modified array

Link copied to clipboard
external fun filter(predicate: (value: JsFloat16) -> Boolean): Float16Array<ArrayBuffer>

Returns the elements of an array that meet the condition specified in a callback function.

Link copied to clipboard
external fun find(predicate: (value: JsFloat16) -> Boolean): JsFloat16?

Returns the value of the first element in the array where predicate is true, and undefined otherwise.

Link copied to clipboard
external fun findIndex(predicate: (value: JsFloat16) -> Boolean): Int

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

Link copied to clipboard
external fun findLast(predicate: (value: JsFloat16) -> Boolean): JsFloat16?

Returns the value of the last element in the array where predicate is true, and undefined otherwise.

Link copied to clipboard
external fun findLastIndex(predicate: (value: JsFloat16) -> Boolean): Int

Returns the index of the last element in the array where predicate is true, and -1 otherwise.

Link copied to clipboard
open external override fun forEach(action: (item: JsFloat16) -> Unit)

Performs the specified action for each element in an array.

Link copied to clipboard
open operator external fun get(index: Int): JsFloat16
Link copied to clipboard
external fun includes(searchElement: JsFloat16, fromIndex: Int = definedExternally): Boolean

Determines whether an array includes a certain element, returning true or false as appropriate.

Link copied to clipboard
external fun indexOf(searchElement: JsFloat16, fromIndex: Int = definedExternally): Int

Returns the index of the first occurrence of a value in an array.

Link copied to clipboard
operator fun <T : JsAny?> JsIterable<T>.iterator(): Iterator<T>
Link copied to clipboard
external fun join(separator: String = definedExternally): String

Adds all the elements of an array separated by the specified separator string.

Link copied to clipboard
open external fun keys(): JsIterator<JsInt>
Link copied to clipboard
external fun lastIndexOf(searchElement: JsFloat16, fromIndex: Int = definedExternally): Int

Returns the index of the last occurrence of a value in an array.

Link copied to clipboard
external fun map(transform: (value: JsFloat16) -> JsFloat16): Float16Array<ArrayBuffer>

Calls a defined callback function on each element of an array, and returns an array that contains the results.

Link copied to clipboard
external fun reduce(operation: (previousValue: JsFloat16, currentValue: JsFloat16, currentIndex: Int) -> JsFloat16): JsFloat16
external fun <U : JsAny?> reduce(operation: (previousValue: U, currentValue: JsFloat16, currentIndex: Int) -> U, initialValue: U): U

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.

Link copied to clipboard
external fun reduceRight(operation: (previousValue: JsFloat16, currentValue: JsFloat16, currentIndex: Int) -> JsFloat16): JsFloat16
external fun <U : JsAny?> reduceRight(operation: (previousValue: U, currentValue: JsFloat16, currentIndex: Int) -> U, initialValue: U): U

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.

Link copied to clipboard
external fun reverse(): Float16Array<B>

Reverses the elements in an Array.

Link copied to clipboard
open operator external fun set(index: Int, value: JsFloat16)

external fun set(array: ArrayLike<JsFloat16>, offset: Int = definedExternally)
external fun set(array: ReadonlyArray<JsFloat16>, offset: Int = definedExternally)
Link copied to clipboard
external fun slice(start: Int = definedExternally, end: Int = definedExternally): Float16Array<ArrayBuffer>

Returns a section of an array.

Link copied to clipboard
external fun some(predicate: (value: JsFloat16) -> Boolean): Boolean

Determines whether the specified callback function returns true for any element of an array.

Link copied to clipboard
external fun sort(comparison: (a: JsFloat16, b: JsFloat16) -> Int = definedExternally): Float16Array<B>

Sorts an array.

Link copied to clipboard
external fun subarray(start: Int, end: Int): Float16Array<B>
Link copied to clipboard
fun TypedArray<*, *, *, *>.toByteArray(): ByteArray
Link copied to clipboard
Link copied to clipboard
external fun toLocaleString(): String

Converts a number to a string by using the current locale.

Link copied to clipboard

Copies the array and returns the copy with the elements in reverse order.

Link copied to clipboard
external fun toSorted(comparison: (a: JsFloat16, b: JsFloat16) -> Int = definedExternally): Float16Array<ArrayBuffer>

Copies and sorts the array.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
external fun valueOf(): Float16Array<B>

Returns the primitive value of the specified object.

Link copied to clipboard
open external fun values(): JsIterator<JsFloat16>
Link copied to clipboard
external fun with(index: Int, value: JsFloat16): Float16Array<ArrayBuffer>

Copies the array and inserts the given number at the provided index.