-
Notifications
You must be signed in to change notification settings - Fork 0
randomEntry
Subhajit Sahu edited this page Dec 28, 2022
·
1 revision
Pick an arbitrary entry.
Similar: randomEntry, hasEntry.
function randomEntry(x, fr)
// x: lists
// fr: random number generator ([0, 1))
const xlists = require('extra-lists');
var x = [['a', 'b', 'c'], [1, 2, 3]];
xlists.randomEntry(x);
// → [ 'c', 3 ]
xlists.randomEntry(x);
// → [ 'b', 2 ]