1.0.0 • Published 4 years ago

random-array-element v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Random Array Element

How to use

First, install the random array element package $ npm i random-array-element Then, require it in your code

const randomArrayElement = require('random-array-element')
//or this
const rae = require('random-array-element')

Now, use the module function to get your random array element (whatever you named the require constant)

const rae = require('random-array-element')
const array = [1,2,3,4,5,6,7,8,9]
const string = "This is a string"
console.log(rae(array)) //outputs something like 3
console.log(rae(string)) //outputs "Not an array" because it is not an array

Last version 1.0.0 released on 5/14/2021