getNext()function
getNext(items: PossibleArray<T>, item: T): T | undefined
| Param | Type | |
|---|---|---|
items | PossibleArray<T> | The array or iterable to search. required |
item | T | The item to find the successor of. required |
| Return | |
|---|---|
T | undefined | The item following item, or undefined if item is missing or last. |
Get the next item in an array or iterable.
Examples
getNext([1, 2, 3], 2) // 3