Typed Array find()
Description
The find()
method returns the value of the first element that passes a test.
The find()
method executes a function for each array element.
The find()
method returns undefined
if no elements are found.
The find()
method does not execute the function for empty elements.
The find()
method does not change the original array.
Syntax
typed-array.find(function(currentValue, index, arr),thisValue)
typed-array must be on of the following: Int8ArrayUint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float16Array Float32Array Float64Array BigInt64Array BigUint64Array |
Parameters
function() | Required. A function to run for each array element. |
currentValue | Required. The value of the current element. |
index | Optional. The index of the current element. |
arr | Optional. The array of the current element. |
thisValue | Optional. Default undefined .A value passed to the function as its this value. |
Return Value
Type | Description |
A value |
The value of the first element that pass the test. Otherwise it returns undefined . |
JavaScript Typed Arrays
Browser Support
typed-array.of()
is an ECMAScript6 (ES6 2015) feature.
JavaScript 2015 is fully supported in all modern browsers since June 2017:
Chrome 51 | Edge 15 | Firefox 54 | Safari 10 | Opera 38 |
May 2016 | Apr 2017 | Jun 2017 | Sep 2016 | Jun 2016 |
typed-array.of()
is not supported in Internet Explorer.