the-simplifier
  • ๐Ÿ’šWelcome!
  • ๐Ÿ“ฆInstalling
  • Functions
    • The Simplifier Functions
  • ๐ŸŽซValidators
    • ๐ŸŸขisWebsiteUp
    • #๏ธโƒฃ isValidHexColor
  • ๐ŸŽกConverters
    • โฑ๏ธconvertTime
    • ๐Ÿ”ตconvertColors
  • ๐Ÿ“”Formatters
    • ๐Ÿ”ขNumberFormatter
  • ๐Ÿ“ธOCR
    • ๐Ÿ“‘๐Ÿ“ท readImage
  • โŒFakes
    • ๐ŸงชcreateFakeUser
  • ๐Ÿ”…Modified native functions
    • ๐Ÿ“œMap
  • ๐ŸŒNo category
    • ๐Ÿ”ƒgetRandomFromArray
    • ๐Ÿ” generateChars
    • ๐Ÿ”„getRandomInt
Powered by GitBook
On this page

Was this helpful?

  1. No category

getRandomFromArray

Get a random item from an array!

Getting a random item from an array!

randomFromArray.js
import { getRandomFromArray } from 'the-simplifier'

let random = async() => {
  let array = [1, 'two', true]

  let result = getRandomFromArray(array)

  console.log(result)
}

random() // Expected: A random item from array

PreviousNo categoryNextgenerateChars

Last updated 4 years ago

Was this helpful?

๐ŸŒ
๐Ÿ”ƒ