takeRight
Import from @varavel/vdl-plugin-sdk/utils/arrays.
Returns a new array containing the last count elements from the input array arr.
If count is greater than the length of arr, the entire array is returned.
Type Parameters
| Type Parameter | Description |
|---|---|
T |
The type of elements in the array. |
Parameters
| Parameter | Type | Description |
|---|---|---|
arr |
readonly T[] |
The array to take elements from. |
count? |
number |
The number of elements to take. |
guard? |
unknown |
- |
Returns
T[]
A new array containing the last count elements from arr.