You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

10 lines
263 B

export default function some(values, test) {
if (typeof test !== "function") throw new TypeError("test is not a function");
let index = -1;
for (const value of values) {
if (test(value, ++index, values)) {
return true;
}
}
return false;
}