MDN Web Docs
developer.mozilla.org โบ en-US โบ docs โบ Web โบ JavaScript โบ Reference โบ Global_Objects โบ Array โบ some
Array.prototype.some() - JavaScript | MDN
The some() method of Array instances returns true if it finds an element in the array that satisfies the provided testing function. Otherwise, it returns false.
W3Schools
w3schools.com โบ jsref โบ jsref_some.asp
JavaScript Array some() Method
The some() method checks if any array elements pass a test (provided as a callback function).
Videos
04:00
#8: Array .some() Method | JavaScript Array Methods - YouTube
06:39
JavaScript Array some method - YouTube
02:00
Check If Some Items Pass a Condition - JavaScript Array Some (In ...
What does the SOME() array method do? - YouTube
JavaScript Array Methods in Minutes: SOME() โ 3 EXAMPLES! - YouTube
14:58
Array some Method in JavaScript | JavaScript Array Methods | ...
Programiz
programiz.com โบ javascript โบ library โบ array โบ some
Javascript Array some() (with Examples)
We have then passed callback to the some() method as ageArray.some(checkMinor) that checks for elements less than 18 and returns true. // array of scores obtained by student let scoreObtained = [45, 50, 39, 78, 65, 20]; // a test function: returns score less than 40 function studentIsPassed(score) ...
JavaScript Tutorial
javascripttutorial.net โบ home โบ javascript array methods โบ array.prototype.some()
JavaScript Array some() Method
November 8, 2024 - In this tutorial, you will learn how to use the JavaScript Array some() method to test if at least one element in the array passes a test.
TutorialsPoint
tutorialspoint.com โบ home โบ javascript โบ javascript array some() method
JavaScript Array some() Method
September 1, 2008 - After executing the above program, the some() method returns "true" because at least one element (2) in the numbers array is positive. ... In this example, we are checking for atleast one string element that has a lenght of '5'.
MDN Web Docs
developer.mozilla.org โบ en-US โบ docs โบ Web โบ JavaScript โบ Reference โบ Global_Objects โบ TypedArray โบ some
TypedArray.prototype.some() - JavaScript | MDN
function isNegative(element, index, array) { return element < 0; } const int8 = new Int8Array([-10, 20, -30, 40, -50]); const positives = new Int8Array([10, 20, 30, 40, 50]); console.log(int8.some(isNegative)); // Expected output: true console.log(positives.some(isNegative)); // Expected output: false
freeCodeCamp
freecodecamp.org โบ news โบ javascript-array-some-tutorial-how-to-iterate-through-elements-in-an-array
JavaScript Array.some() Tutorial โ How to Iterate Through Elements in an Array
October 15, 2024 - In addition to the callback function, some() can also take in a context object. ... We can then refer to the object from inside the callback function on each iteration, using this as a reference. This allows us to access any properties or methods defined inside the context object. In this example, we are looking to check if at least one person in the people array is a tricenarian.
TutorialsPoint
tutorialspoint.com โบ home โบ typescript โบ typescript array some method
TypeScript Array Some Method
December 18, 2016 - If some element passes the test, then it returns true, otherwise false. function isBigEnough(element, index, array) { return (element >= 10); } var retval = [2, 5, 8, 1, 4].some(isBigEnough); console.log("Returned value is : " + retval ); var ...
Medium
medium.com โบ poka-techblog โบ simplify-your-javascript-use-some-and-find-f9fb9826ddfd
Simplify your JavaScript โ Use .some() and .find() | by Etienne Talbot | poka-techblog | Medium
September 5, 2019 - Well, you pass .some() a function as the argument. That function runs for each value in the array. You can then see if the value fits the condition youโve written. The function must return a boolean (although a truthy/falsy value works as well). As soon as one true is returned, .some() will itself return true.
DEV Community
dev.to โบ amirfakour โบ understanding-some-and-every-array-methods-in-javascript-59fh
Understanding "some" and "every" Array Methods in Javascript - DEV Community
June 12, 2023 - In the first checkUsers function, we use a for loop to iterate through the users array and manually update the allAdults and anyFromNewYork variables. This approach is more complex and harder to read. In the second checkUsersWithSomeAndEvery function, we use the every and some methods to achieve the same result.
GeeksforGeeks
geeksforgeeks.org โบ typescript โบ typescript-array-some-method
TypeScript Array some() Method - GeeksforGeeks
July 12, 2024 - The Array.some() method in TypeScript is used to check if at least one element in the array passes the test implemented by the provided function.
MDN Web Docs
developer.mozilla.org โบ en-US โบ docs โบ Web โบ JavaScript โบ Reference โบ Global_Objects โบ Array
Array - JavaScript | MDN
Other methods mutate the array that the method was called on, in which case their return value differs depending on the method: sometimes a reference to the same array, sometimes the length of the new array.