---
title: "Discussion on \"How to clone anything in JavaScript\" | Hashnode"
description: "Discussion on \"How to clone anything in JavaScript\". The global structuredClone() can be used to create a deep copy of a given value.\nExample\nIn this example, we clone an object. After cloning, changes to each object do not affect the other object.\nconst fruits = {\n  citrus: [\"orange\", \"grapefruit\", \"l..."
url: "https://hashnode.com/posts/how-to-clone-anything-in-javascript/63b6cb263097179674d95b73"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to clone anything in JavaScript](https://irousta.hashnode.dev/how-to-clone-anything-in-javascript?utm_source=hashnode&utm_medium=feed)

The global structuredClone() can be used to create a deep copy of a given value. Example In this example, we clone an object. After cloning, changes to each object do not affect the other object. const fruits = { citrus: \["orange", "grapefruit", "l...

Jan 5, 2023 · 1 min read · irousta.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#structuredclone](https://hashnode.com/tag/structuredclone)
-   [#structured-clone-javascript](https://hashnode.com/tag/structured-clone-javascript)
-   [#deep-clone-javascript](https://hashnode.com/tag/deep-clone-javascript)
-   [#clone-object-javascript](https://hashnode.com/tag/clone-object-javascript)

## Written by

[Iman Rousta](https://hashnode.com/@irousta)

@irousta

  
[View profile](https://hashnode.com/@irousta)

Front-end developer

Front-end developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
