random-array-element

1.0.0 • Public • Published

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

/random-array-element/

    Package Sidebar

    Install

    npm i random-array-element

    Weekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    1.2 kB

    Total Files

    3

    Last publish

    Collaborators

    • mrslurpyboi