random.index() - shysolocup/stews GitHub Wiki

chooses a random index in an object
type: Function


arguments:

  • ?object Any
    thing that it'll randomly choose an index from
    if not given it'll default to the binder

list: pair:
const { random } = require('stews');

let arr = ["a", "b", "c"];

console.log(random.index(arr));
const { random } = require('stews');

let obj = { key1: "val1", key2: "val2" };

console.log(random.index(obj));
2
0


⚠️ **GitHub.com Fallback** ⚠️