Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/marijnh/Eloquent-JavaScript
/ every
Function
every
code/solutions/05_3_everything.js:1–6 ·
view source on GitHub ↗
(array, predicate)
Source
from the content-addressed store, hash-verified
1
function
every(array, predicate) {
2
for
(
let
element of array) {
3
if
(!predicate(element))
return
false;
4
}
5
return
true;
6
}
7
8
function
every2(array, predicate) {
9
return
!array.some(element => !predicate(element));
Callers
1
05_3_everything.js
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected