(values, test)
| 1239 | } |
| 1240 | |
| 1241 | function every(values, test) { |
| 1242 | if (typeof test !== "function") throw new TypeError("test is not a function"); |
| 1243 | let index = -1; |
| 1244 | for (const value of values) { |
| 1245 | if (!test(value, ++index, values)) { |
| 1246 | return false; |
| 1247 | } |
| 1248 | } |
| 1249 | return true; |
| 1250 | } |
| 1251 | |
| 1252 | function some(values, test) { |
| 1253 | if (typeof test !== "function") throw new TypeError("test is not a function"); |