Favorites

JavaScript Array.prototype.every() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Array.prototype.every()
JavaScript Array Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The every() method checks whether all elements of an array pass a test, returning true or false.

Description

The every() method tests whether all elements pass the test implemented by the callback. It stops as soon as one element fails and returns false; if every element passes, it returns true.

For an empty array it always returns true (there is nothing to fail), which can be surprising when validating input. To check whether at least one element passes, use some().

The callback receives the index and the array as extra arguments, so you can compare each element with its neighbours, for example to check that an array is sorted: arr.every((v, i) => i === 0 || arr[i - 1] <= v). Empty slots in sparse arrays are skipped. It's often used for validation, such as checking that every form field has a value.

Syntax

array.every(callbackFn)
array.every(callbackFn, thisArg)

Parameters

  • callbackFnA function that tests each element. It should return a truthy value to keep going, and receives element, index and array.
  • thisArgOptional. A value to use as this inside callbackFn.

Return Value

true if the callback returns a truthy value for every element, otherwise false. An empty array returns true.

Example

const scores = [72, 88, 95];
console.log(scores.every(s => s >= 50));
console.log(scores.every(s => s >= 80));
console.log([].every(s => s > 100));

Browser Support

The following information will show you the current browser support for the Array.prototype.every() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee