# Sandbox.SandboxSystemExtensions.FromArray

```csharp
static T FromArray(System.Random self, T[] array, T defVal = null)
```

Returns a random value in an array

### Parameters

- `self` (`System.Random`)
- `array` (`T[]`)
- `defVal` (`T`), default `null`

### Returns

`T`

Declared in [Sandbox.SandboxSystemExtensions](/api/Sandbox.SandboxSystemExtensions).
Assembly: `Sandbox.System`.
