sample

get a random element from given collection


Parameters

sample collection :block :range

Returns

  • :null
  • :any

Examples

copy
sample [1 2 3] ; (return a random number from 1 to 3) print sample ["apple" "appricot" "banana"] ; apple

Related