---
name: "up.util.copy"
area: "API"
kind: "JavaScript function"
parent: "up.util module"
url: "https://unpoly.com/api/up.util.copy"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.util module](https://unpoly.com/api/up.util.md)</nav>

# up.util.copy(object)

Returns a shallow copy of the given value.

<nav aria-label="Contents">

#### Contents

- [Copying protocol](#copying-protocol)
- [Parameters](#parameters)
- [Return value](#return-value)

</nav>

## Copying protocol {#copying-protocol}

- By default `up.util.copy()` can copy [array-like values](https://unpoly.com/api/List.md), plain objects and `Date` instances.
- Array-like objects are copied into new arrays.
- Unsupported types of values are returned unchanged.
- To make the copying protocol work with user-defined class, see [`up.util.copy.key`](https://unpoly.com/api/up.util.copy.key.md).
- Immutable objects, like strings or numbers, do not need to be copied.

---

## Parameters {#parameters}

### object {#object}

(required)

Type: any

---

## Return value {#return-value}

Type: any

