> For the complete documentation index, see [llms.txt](https://polux.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polux.gitbook.io/docs/arrays/random.md).

# \_.random

Returns a random element from an array

## \_.random(array, start?, end?)

> **Parameters:**

* **array \[array]:** <mark style="color:yellow;">`the array with the elements`</mark>
* **start?:**  <mark style="color:yellow;">`sets the minimum random index`</mark>
* **end?:** <mark style="color:yellow;">`sets the maximum random index`</mark>

> **Example**:

```javascript
_.random([10,20,30,40,50])
// => Random value
_.random([10,20,30,40,50], 2)
// => 30, 40 or 50
_.random([10,20,30,40,50], 2, 3)
// => 30 or 40
```
