3.1.2 • Published 7 years ago
calculate-from-index-x v3.1.2
calculate-from-index-x
Calculates a fromIndex of a given value for an array.
module.exports(array, fromIndex) ⇒ number ⏏
This method calculates a fromIndex 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 calcFromIndex from 'calculate-from-index-x';
console.log(calcFromIndex([1, 2, 3], 1)); // 1
console.log(calcFromIndex([1, 2, 3], Infinity)); // Infinity
console.log(calcFromIndex([1, 2, 3], -Infinity)); // 0
console.log(calcFromIndex([1, 2, 3], -1)); // 23.1.2
7 years ago
3.1.1
7 years ago
3.1.0
7 years ago
3.0.19
7 years ago
3.0.18
7 years ago
3.0.17
7 years ago
3.0.16
7 years ago
3.0.15
7 years ago
3.0.14
7 years ago
3.0.13
7 years ago
3.0.12
7 years ago
3.0.11
7 years ago
3.0.10
7 years ago
3.0.9
7 years ago
3.0.8
7 years ago
3.0.7
7 years ago
3.0.6
7 years ago
3.0.5
7 years ago
3.0.4
7 years ago
3.0.3
7 years ago
3.0.2
7 years ago
3.0.1
7 years ago
2.2.0
8 years ago
2.1.0
9 years ago
2.0.1
9 years ago
2.0.0
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago