๐ŸŒ
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).
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
Refine
refine.dev โ€บ home โ€บ blog โ€บ tutorials โ€บ how to use javascript array some
How to Use JavaScript Array some | Refine
November 4, 2024 - To use the JavaScript Array.prototype.some method, can declare the test inside a callback function, so that we can pass it to some() at invocation. For example, as in the case below for checking if a number in the array is even or not:
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript-array-some-method
JavaScript Array some() Method | GeeksforGeeks
July 12, 2024 - Example: In this example the Function checkAvailability checks if a value exists in an array using some().
๐ŸŒ
Ultimate Courses
ultimatecourses.com โ€บ blog โ€บ array-some-javascript
Exploring Array Some in JavaScript - Ultimate Courses
Give the live Array Some demo a try, you can toggle promo: true to promo: false and see the result change: Letโ€™s check out a for...in loop example that mimics the behaviour of Array Some:
๐ŸŒ
4Geeks
4geeks.com โ€บ how-to โ€บ javascript-array-some-method
How to use the Javascript array some method?
July 16, 2025 - Nowadays known as one of the most familiar Arrays methods to test in Javascript we have the Array Some method. What some() method performs is testing whether at least one element of the array matches the test executed by our custom function.
๐ŸŒ
Flexiple
flexiple.com โ€บ javascript โ€บ javascript-array-some-method
JavaScript's Array some() Method - Flexiple
The some() method executes a user-provided callback function on each element of the array until it finds one where the callback returns a truthy value. If such an element is found, some() immediately returns true; otherwise, it returns false.
๐ŸŒ
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.
๐ŸŒ
Fjolt
fjolt.com โ€บ article โ€บ javascript-array-some
Javascript Array Some Method
The some method takes one callback function, which can have 3 different arguments: element - the element being iterated over. In the example above, Iโ€™ve named it x. index - the index of array element we are iterating over currently.
๐ŸŒ
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.
๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ understanding-distinction-arraysome-vs-arrayfind-shuaibu-muhammad-20j9f
Understanding the Distinction: Array.some() vs. Array.find() in JavaScript
February 26, 2024 - This approach is efficient for large arrays since it stops iterating as soon as it finds a matching element. ... const numbers = [1, 3, 5, 6, 7]; const hasEven = numbers.some(num => num % 2 === 0); // Output: true
๐ŸŒ
JavaScript in Plain English
javascript.plainenglish.io โ€บ javascript-array-some-and-every-2975e0cc12f0
JavaScript Array.some() and every() | by Sateesh Gandipadala | JavaScript in Plain English
December 27, 2019 - const array = [10, 0, 2, -11, 5, 6];const isNegative = (number) => number < 0;if(array.some(isNegative)) { // do something } The some() method stops executing when the callback returns true, in the above example when it reaches -11 it found ...