getItem static method

dynamic getItem(
  1. List list
)

Randomly selects an item from a list.

Implementation

static dynamic getItem(List list) {
  return list[random.nextInt(list.length)];
}