https://github.com/writetome51/get-countup-countdown
2 functions that return array of numbers in ascending order, and array of numbers in descending order, respectively.
https://github.com/writetome51/get-countup-countdown
array javascript numbers typescript
Last synced: 11 months ago
JSON representation
2 functions that return array of numbers in ascending order, and array of numbers in descending order, respectively.
- Host: GitHub
- URL: https://github.com/writetome51/get-countup-countdown
- Owner: writetome51
- License: mit
- Created: 2019-03-21T23:17:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-12T16:04:29.000Z (over 5 years ago)
- Last Synced: 2025-02-03T04:44:09.748Z (12 months ago)
- Topics: array, javascript, numbers, typescript
- Language: TypeScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# getCountup(
startingNumber,
endingNumber,
increment? = 1
): number[]
Returns array of numbers in ascending order, i.e., [1,2,3,4,5...].
# getCountdown(
startingNumber,
endingNumber,
increment? = 1
): number[]
Returns array of numbers in descending order, i.e., [5,4,3,2,1...].
## Examples
```js
getCountup(1, 5);
// --> [1,2,3,4,5]
getCountdown(5, 1);
// --> [5,4,3,2,1]
getCountup(-1, 10, 1.5);
// --> [ -1, 0.5, 2, 3.5, 5, 6.5, 8, 9.5 ]
getCountdown(10, -1, 1.5);
// --> [ 10, 8.5, 7, 5.5, 4, 2.5, 1, -0.5 ]
```
## Installation
`npm i @writetome51/get-countup-countdown`
## Loading
```js
import {getCountup, getCountdown} from '@writetome51/get-countup-countdown';
```