0.1.2 • Published 6 years ago

number-to-array v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Number To Array

Consider this situation where you would require an array of certain number or till certain number say from 0 or any other start point, to resolve this we use number-to-array functionality.

Installation

yarn add number-to-array

Usage

const { numberToArray} = require('number-to-array')

Scenario

1) To get the number of array from 0 to the provided input : numberToArray(5); Output : 0, 1, 2, 3, 4, 5

2) To get the number of array from provided start point to provided end point : numberToArray(5, 7); Output: 5, 6, 7

3) To get array out of string provided with a seperator: numberToArray('hey hey hey',true, 'e') // true indicates its a string Output: 'h', 'y h', 'y h', 'y'

The code is all yours :)