Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thatwasawkward/whate

Extremely simple NPM module for getting a random value from an array. Completely indifferent.
https://github.com/thatwasawkward/whate

array arrays npm npm-module npm-package npmjs random

Last synced: 4 days ago
JSON representation

Extremely simple NPM module for getting a random value from an array. Completely indifferent.

Awesome Lists containing this project

README

        

# Whate

Extremely simple module for getting a random value from an array. Completely indifferent.

## whate.ver(array)

Returns a completely random value from the array.

### Example

```javascript
const whate = require('whate')

const array = [
'one',
'two',
'three'
]

const randomValue = whate.ver(array)

console.log(randomValue) // 'one', 'two', or 'three'
```

### Other stuff, in case you need it

**whate.str(array)**
Returns a random string.

**whate.num(array)**
Returns a random number.

**whate.int(array)**
Returns a random integer.

**whate.arr(array)**
Returns a random array.

**whate.obj(array)**
Returns a random non-array object.