Hooks
Functions
isLastChild
A function to discriminate last index of an array.
Example
import isLastChild from '@/utils/isLastChild'
const name = isLastChild([1, 2, 3, 4, 5], 4)
// output: true
Params
| param | Description | Type | Default |
|---|---|---|---|
| arr | Array | Array | - |
| index | Current index | number | - |
Return
| return | Description | Type | Default |
|---|---|---|---|
| lastChild | Whether the input index is last of the array. | boolean | - |