* The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`.
(array, n)
| 3748 | * @returns {*} Returns the nth element of `array`. |
| 3749 | */ |
| 3750 | function baseNth(array, n) { |
| 3751 | var length = array.length; |
| 3752 | if (!length) { |
| 3753 | return; |
| 3754 | } |
| 3755 | n += n < 0 ? length : 0; |
| 3756 | return isIndex(n, length) ? array[n] : undefined; |
| 3757 | } |
| 3758 | |
| 3759 | /** |
| 3760 | * The base implementation of `_.orderBy` without param guards. |