【JavaScript】DeepCopy 方式整理

Allen Huang
Sep 9, 2018 · 1 min read

1. Object.assign

  • 僅支援一層

2. …obj

  • 僅支援一層

3. 序列化成JSON字串,再轉回物件

  • 支援多層

4. Lodash

  • 支援多層

Sample

Reference

Allen的技術筆記

工作上學到什麼就寫些什麼!!!

Allen Huang

Written by

Allen的技術筆記

工作上學到什麼就寫些什麼!!!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade