# .randomElement

## Overview

Chooses from an array of data.

### Subjects

## Sample Codes

```swift
let numbers = [100, 80, 85]

if let winner = numbers.randomElement() {
    print("The winning number is \(winner).")
}
```

## Sources

### Videos

### Articles / Documents

* [Hacking with Swift / How to get a random element from an array using randomElement()](https://www.hackingwithswift.com/example-code/language/how-to-get-a-random-element-from-an-array-using-randomelement)
