W3Schools
w3schools.com › js › js_array_iteration.asp
W3Schools.com
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... Array iteration methods operate on every array item.
Factsheet
Paradigms Multi-paradigm: event-driven, functional, imperative, procedural, object-oriented
Family ECMAScript
Designed by Brendan Eich of Netscape first; then others contributed to ECMAScript standard
Paradigms Multi-paradigm: event-driven, functional, imperative, procedural, object-oriented
Family ECMAScript
Designed by Brendan Eich of Netscape first; then others contributed to ECMAScript standard
Wikipedia
en.wikipedia.org › wiki › JavaScript
JavaScript - Wikipedia
December 31, 2025 - In JavaScript, an object is an associative array, augmented with a prototype (see below); each key provides the name for an object property, and there are two syntactical ways to specify such a name: dot notation (obj.x = 10) and bracket notation (obj["x"] = 10).
What is the equivalent of Array.any? in JavaScript? - Stack Overflow
I'm looking for a method for JavaScript that returns true or false when it's empty... something like Ruby any? or empty? [].any? #=> false [].empty? #=> true More on stackoverflow.com
How to get any arrays and nothing else from an object?
If I have an object that looks like the following: { a: "String", b: [1, 2, 3], c: ["a", "b", "c"] } …meaning it contains one or more arrays and sometimes some other stuff like strings as well. With Object.values(myObject) I can get the values, but what would be the best way to get all the ... More on sitepoint.com
Are rhere any simpler ways to measure length of an array in JS?
Really helpful illustration of JS array methods
When you've gotten comfortable with map, filter, and reduce your code becomes so much cleaner More on reddit.com
Videos
JavaScript Array Methods in Minutes: SOME() — 3 EXAMPLES! - YouTube
08:59
Array.every(), Array.some() Javascript | Javascript Tutorial - YouTube
05:08
#7: Array .every() Method | JavaScript Array Methods - YouTube
05:46
10 JavaScript Array Methods Every Dev Should Know #javascript - ...
47:42
Every JavaScript Array Method Explained With Examples - YouTube
JavaScript Array Methods in Minutes: AT() — 3 EXAMPLES! - YouTube
Top answer 1 of 14
278
The JavaScript native .some() method does exactly what you're looking for:
function isBiggerThan10(element, index, array) {
return element > 10;
}
[2, 5, 8, 1, 4].some(isBiggerThan10); // false
[12, 5, 8, 1, 4].some(isBiggerThan10); // true
2 of 14
138
JavaScript has the Array.prototype.some() method:
[1, 2, 3].some((num) => num % 2 === 0);
returns true because there's (at least) one even number in the array.
In general, the Array class in JavaScript's standard library is quite poor compared to Ruby's Enumerable. There's no isEmpty method and .some() requires that you pass in a function or you'll get an undefined is not a function error. You can define your own .isEmpty() as well as a .any() that is closer to Ruby's like this:
Array.prototype.isEmpty = function() {
return this.length === 0;
}
Array.prototype.any = function(func) {
return this.some(func || function(x) { return x });
}
Libraries like underscore.js and lodash provide helper methods like these, if you're used to Ruby's collection methods, it might make sense to include them in your project.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › some
Array.prototype.some() - JavaScript | MDN
1 week ago - 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.
Playwright
playwright.dev › assertions
Assertions | Playwright
Playwright includes test assertions in the form of expect function. To make an assertion, call expect(value) and choose a matcher that reflects the expectation. There are many generic matchers like toEqual, toContain, toBeTruthy that can be used to assert any conditions · Playwright also includes ...
DigitalOcean
digitalocean.com › community › tutorials › using-every-and-some-to-manipulate-javascript-arrays
How To Use .every() and .some() to Manipulate JavaScript Arrays | DigitalOcean
December 12, 2019 - Almost every usage of MFR where you need to exit early and not comb through the entire collection is a prime candidate for .some() or .every(), because they both short-circuit and exit the array iteration as early as possible, instead of running till the end and potentially wasting compute resources.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › every
Array.prototype.every() - JavaScript | MDN
1 week ago - The array every() was called upon. ... A value to use as this when executing callbackFn. See iterative methods. true unless callbackFn returns a falsy value for an array element, in which case false is immediately returned.
GitHub
github.com › zloirock › core-js
GitHub - zloirock/core-js: Standard Library · GitHub
Includes polyfills for ECMAScript ... iterators, typed arrays, many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like URL. You can load only required features or use it without global namespace pollution. core-js isn't backed by a ...
Author zloirock
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array
Array - JavaScript | MDN
1 week ago - JavaScript arrays are not associative arrays and so, array elements cannot be accessed using arbitrary strings as indexes, but must be accessed using nonnegative integers (or their respective string form) as indexes.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › with
Array.prototype.with() - JavaScript | MDN
July 10, 2025 - The with() method never produces a sparse array. If the source array is sparse, the empty slots will be replaced with undefined in the new array. The with() method is generic. It only expects the this value to have a length property and integer-keyed properties. js ·