number-to-array
v0.1.2
Published
a mini library to convert say given input to an array it can be just the end number or a string or anything
Readme
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
To get the number of array from 0 to the provided input : numberToArray(5); Output : [ 0, 1, 2, 3, 4, 5 ]
To get the number of array from provided start point to provided end point : numberToArray(5, 7); Output: [ 5, 6, 7 ]
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 :)
