Skip to content

randomEntry

Subhajit Sahu edited this page Dec 28, 2022 · 1 revision

Pick an arbitrary entry.

Similar: randomEntry, hasEntry.


function randomEntry(x, fr)
// x:  ilists
// fr: random number generator ([0, 1))
const xilists = require('extra-ilists');

var x = [['a', 'b', 'c'], [1, 2, 3]];
xilists.randomEntry(x);
// → [ 'c', 3 ]

xilists.randomEntry(x);
// → [ 'b', 2 ]


References

Clone this wiki locally