Skip to main content

randomMultipleFromArray

randomMultipleFromArray(random, source, target, count) ⇒ number

Pick multiple random items from an array

Kind: global function
Returns: number - number of picked elements

ParamTypeDescription
randomfunctionrandom function, must return a value between 0 and 1
sourceArray.<T>Where to pick elements from
targetArray.<T>Where to place picked elements
countnumberhow many items to pick, if this number is greater than the length of source, it will be limited to length of source instead