3.1.2 • Published 5 years ago
calculate-from-index-right-x v3.1.2
calculate-from-index-right-x
Calculates a fromIndexRight of a given value for an array.
module.exports(array, fromIndex)
⇒ number ⏏
This method calculates a fromIndexRight of a given value for an array.
Kind: Exported function
Returns: number - The calculated fromIndex. Default is 0.
Throws:
- TypeError If array is null or undefined.
Param | Type | Description |
---|---|---|
array | Array | The array on which to calculate the starting index. |
fromIndex | number | The position in this array at which to begin. A negative value gives the index of array.length + fromIndex by asc. |
Example
import calcFromIndexRight from 'calculate-from-index-right-x';
calcFromIndexRight([1, 2, 3], 1); // 1
calcFromIndexRight([1, 2, 3], Infinity); // 2
calcFromIndexRight([1, 2, 3], -Infinity); // -Infinity
calcFromIndexRight([1, 2, 3], -1); // 2
3.1.2
5 years ago
3.1.1
5 years ago
3.1.0
5 years ago
3.0.11
5 years ago
3.0.10
5 years ago
3.0.9
5 years ago
3.0.8
5 years ago
3.0.7
5 years ago
3.0.6
5 years ago
3.0.5
5 years ago
3.0.4
5 years ago
3.0.3
5 years ago
3.0.2
5 years ago
3.0.1
5 years ago
3.0.0
5 years ago
2.1.0
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago