get-value-from-value-or-array

1.0.1 • Public • Published

USAGE

const getValueFrom = require('get-value-from-value-or-array')

let myConfig = {
    totalUsers:[0,10,[1,2,3]]
}
let totalUsersToCreateNow = getValueFrom(myConfig.totalUsers)
//now we have 33% chance to get 0, and 33% to 10, and 11% to get 1, 11% get 2, 11% to get 3
console.log(totalUsersToCreateNow)

You can use that to create situations to get chances to result for games or fake bot usage

Package Sidebar

Install

npm i get-value-from-value-or-array

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

1.16 kB

Total Files

3

Last publish

Collaborators

  • reytuty