🌐
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.
🌐
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.
🌐
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.
🌐
O'Reilly
oreilly.com › library › view › javascript-the-definitive › 9781449393854 › rn01re22.html
Array.some() - JavaScript: The Definitive Guide, 6th Edition [Book]
May 3, 2011 - The optional this value for invocations ... (or a falsy value) for all elements. The some() method tests whether a condition holds for at least one element of an array....
Author   David Flanagan
Published   2011
Pages   1093
🌐
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.
🌐
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.
🌐
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