[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Array](https://evolu.dev/docs/api-reference/common/Array) › shiftFromArray

```ts
function shiftFromArray<T>(array: [T, ...T[]]): T;
```

Defined in: [packages/common/src/Array.ts:774](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Array.ts#L774)

Shifts (removes and returns) the first element from a non-empty mutable
array.

**Mutates** the original array.

### Example

```ts
// Process a queue of callbacks
const waitingQueue: Array<() => void> = [callback1, callback2];
if (isNonEmptyArray(waitingQueue)) {
  shiftFromArray(waitingQueue)(); // Remove and immediately invoke
}
```