g.js — graphical objects for JavaScript

pickpick

Take random items from a list.

g.pick([1, 2, 3, 4, 5, 6], 3, 44);

With a different seed:

g.pick([1, 2, 3, 4, 5, 6], 3, 99);

Unlike randomSample, pick can return more values than the original:

g.pick([1, 2, 3], 10, 42);

Parameters

  • l: The input list.
  • amount: The amount of items to pick.
  • seed: The random variation.

See Also

  • shuffle: Randomly reorganise items in the list.
  • randomSample: Take a random sample from a list.