1.0.1 • Published 2 years ago

get-value-from-value-or-array v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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