getNext()function

getNext(items: PossibleArray<T>, item: T): T | undefined
ParamType
itemsPossibleArray<T>
The array or iterable to search. required
itemT
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