> For the complete documentation index, see [llms.txt](https://angularjs-store.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://angularjs-store.gitbook.io/docs/v3.0.0/api-reference/copy.md).

# copy

Get a copy of current state.

**@parameters**

| Name            | Type     | Description                           |
| --------------- | -------- | ------------------------------------- |
| ***stateProp*** | `string` | Optional. Specific property of state. |

**@return**

| Type  | Description                             |
| ----- | --------------------------------------- |
| `any` | New copy of state or property of state. |

**Examples:**

Copying the whole state

```javascript
const store = new NgStore({foo: 2, bar: 1});

// { foo: 2, bar: 1 }
const stateCopy = store.copy();
```

Copying specific property of state

```javascript
const store = new NgStore({foo: {bar: 3, baz: 4}});

// { bar: 3, baz: 4 }
const fooCopy = store.copy('foo');
```
