Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/thatwasawkward/whate
- Owner: thatwasawkward
- Created: 2017-11-17T08:35:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T06:31:51.000Z (almost 7 years ago)
- Last Synced: 2024-04-25T22:40:46.210Z (5 months ago)
- Topics: array, arrays, npm, npm-module, npm-package, npmjs, random
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/whate
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.