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