|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
266 bytes
|
| Line | |
|---|
| 1 | function dropWhile(arr, canContinueDropping) {
|
|---|
| 2 | const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr));
|
|---|
| 3 | if (dropEndIndex === -1) {
|
|---|
| 4 | return [];
|
|---|
| 5 | }
|
|---|
| 6 | return arr.slice(dropEndIndex);
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | export { dropWhile };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.