Typed Array some()
Description
The some()
method checks if any array elements pass a test (provided as a callback function).
The some()
method executes the callback function once for each array element.
The some()
method returns true
(and stops) if the function returns
true
for one of the array elements.
The some()
method returns false
if the function returns
false
for all of the array elements.
The some()
method does not execute the function for empty array elements.
The some()
method does not change the original typed array.
Syntax
array.some(function(value, index, arr), this)
Parameters
Parameter | Description | ||||||
function | Required. A function to run for each typed array element. |
||||||
Function parameters:
|
|||||||
this | Optional. Default is undefined .A value passed to the function to be used as its "this" value. |
Return Value
Type | Description |
A boolean |
true if any of the array elements pass the test, otherwise false . |
JavaScript Typed Arrays
Browser Support
typed-array.some()
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.some()
is not supported in Internet Explorer.