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.
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
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.