---
title: "Discussion on \"Shallow and Deep copy in JavaScript\" | Hashnode"
description: "Discussion on \"Shallow and Deep copy in JavaScript\". Shallow Copy\nShallow copy creates copy of an object. New copy has exact copy of values in original object. New copy refers to same reference as original object refers. \n\nExample:\nlet obj = {\n  name: \"John\",\n  age: \"25\"\n};\n\nlet newObj = obj;\n\nnewObj.n..."
url: "https://hashnode.com/posts/shallow-and-deep-copy-in-javascript/62c3c5bbccecfb25bbc7a63b"
---

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

Discussion

# [Shallow and Deep copy in JavaScript](https://sririshi.hashnode.dev/shallow-and-deep-copy-in-javascript?utm_source=hashnode&utm_medium=feed)

Shallow Copy Shallow copy creates copy of an object. New copy has exact copy of values in original object. New copy refers to same reference as original object refers. Example: let obj = { name: "John", age: "25" }; let newObj = obj; newObj.n...

Jul 5, 2022 · 2 min read · sririshi.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#deepcopy](https://hashnode.com/tag/deepcopy)
-   [#shallowcopy](https://hashnode.com/tag/shallowcopy)
-   [#object-oriented-programming](https://hashnode.com/tag/object-oriented-programming)

## Written by

[Rishi Srivastava](https://hashnode.com/@sririshi)

@sririshi

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

Front end developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
