# array.unshift()

Adds an element at the beginning of the array and shifts the rest of the elements to the right.

**Introduced:** 5.3.8.104

```
array.unshift( value=any )
```

**Returns:** numeric

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| value | any | Yes | element to add. |  |

# Examples

```cfml
numbers = [ 1, 2, 3, 4 ];
Dump( numbers.UnShift(  0 ) ); //Outputs 5

moreNumbers = [ 5, 6, 7, 8 ];
Dump( moreNumbers.UnShift(  4 ) ); //Outputs 5
```

# Categories

[Arrays](../../../categories/array.md)

# See Also

[ArrayUnShift()](../../functions/arrayunshift.md), [Array](../array.md)