nthThrows
function nthThrows<T>(list, index): T &
| null
| {
};
Inspired by lodash nth this will select the given index from an array, but throw if the value is undefined.
As with the lodash version of nth it will select from the end of the array given a negative index.
This is likely to be most useful in tests. You might want nthOr, firstOr, or lastOr instead
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
list | T[] |
index | number |
Returns
T &
| null
| {
}