|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
265 bytes
|
| Line | |
|---|
| 1 | export default function every(values, test) {
|
|---|
| 2 | if (typeof test !== "function") throw new TypeError("test is not a function");
|
|---|
| 3 | let index = -1;
|
|---|
| 4 | for (const value of values) {
|
|---|
| 5 | if (!test(value, ++index, values)) {
|
|---|
| 6 | return false;
|
|---|
| 7 | }
|
|---|
| 8 | }
|
|---|
| 9 | return true;
|
|---|
| 10 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.