- What can you do with it?
Generate random sequence of numbers and use them as IDs for your React app or any other app
IDs generated are never the same- no duplicates
- How do i use it?
Simply call the randID()
function anywhere in your code where you need to supply IDs
The function takes an optional parameter, randID(x)
- where x
is the length of the output of your ID depending on your need
If a parameter is not supplied, it uses its default output length [10]
, you can however modify this value in the source code
- What else?
The parameter passed must be greater than 1 and must be an integer
, otherwise nothing will be returned and an error will be logged in the console telling you what happened