source:
node_modules/d3-array/src/some.js
| Last change on this file was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 263 bytes | |
| Rev | Line | |
|---|---|---|
| [e4c61dd] | 1 | export default function some(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 true; | |
| 7 | } | |
| 8 | } | |
| 9 | return false; | |
| 10 | } |
Note:
See TracBrowser
for help on using the repository browser.
