---
title: "Discussion on \"JavaScript 深入解析：Copy by Value、Copy by Reference、Shallow Copy、Deep Copy\" | Hashnode"
description: "Discussion on \"JavaScript 深入解析：Copy by Value、Copy by Reference、Shallow Copy、Deep Copy\". // 1️⃣ Copy by Value (值複製)\n// 適用於原始型別 (Primitive Types)：Number, String, Boolean, Null, Undefined, Symbol, BigInt\nlet a = 10;\nlet b = a; // 這裡是值複製，b 獲得 a 的副本\nb = 20; // 改變 b 不會影響 a\n\nconsole.log(a); // 10\nconsole.log(b); // 20\n\n// 2️⃣ Copy by Reference..."
url: "https://hashnode.com/posts/javascript-copy-by-valuecopy-by-referenceshallow-copydeep-copy/67b74f93a929329c35a0a2a9"
---

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

Discussion

# [JavaScript 深入解析：Copy by Value、Copy by Reference、Shallow Copy、Deep Copy](https://jaoiddd.hashnode.dev/javascript-copy-by-valuecopy-by-referenceshallow-copydeep-copy?utm_source=hashnode&utm_medium=feed)

// 1️⃣ Copy by Value (值複製) // 適用於原始型別 (Primitive Types)：Number, String, Boolean, Null, Undefined, Symbol, BigInt let a = 10; let b = a; // 這裡是值複製，b 獲得 a 的副本 b = 20; // 改變 b 不會影響 a console.log(a); // 10 console.log(b); // 20 // 2️⃣ Copy by Reference...

Feb 20, 2025 · 2 min read · jaoiddd.hashnode.dev  
Read the article

-   [#5re65ou36lkdic8g5rex5ou36lkd](https://hashnode.com/tag/5re65ou36lkdic8g5rex5ou36lkd)
-   [#5byv55so6iih5yc85ykz6yge](https://hashnode.com/tag/5byv55so6iih5yc85ykz6yge)

## Written by

[Dail Log](https://hashnode.com/@Azxo)

@Azxo

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

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
