---
title: merge
framework: Kernel
role: symbol
role_heading: Instance Method
platforms: [driverkit 19.0+, macOS 10.15+]
path: kernel/osarray/3180819-merge
---

# merge

Appends all members of an array to this array.

## Declaration

```occ
bool merge(const OSArray *otherArray);
```

```occ
virtual bool merge(const OSArray *otherArray);
```

## Parameters

- `otherArray`: All members of thie array will be appended to the array.

## Return Value

Return Value true on success, which retains all the added objects, or false on failure which does not retain the objects.

## Discussion

Discussion Appends all members of an array to this array. The array capacity will be grown if necessary.

## See Also

### Creating an Array

- [withArray](kernel/osarray/3180823-witharray.md)
- [withCapacity](kernel/osarray/3180824-withcapacity.md)
- [withObjects](kernel/osarray/3180825-withobjects.md)
- [free](kernel/osarray/3180811-free.md)
- [flushCollection](kernel/osarray/3180810-flushcollection.md)
