Tagged articles
5 articles
Page 1 of 1
JavaScript
JavaScript
Dec 8, 2025 · Frontend Development

Why JSON.parse(JSON.stringify(obj)) Fails for Deep Cloning and Better Alternatives

The article explains the hidden pitfalls of using JSON.parse(JSON.stringify(obj)) for deep cloning in JavaScript, such as circular references, loss of special types, prototype chain, and collection handling, and introduces the native structuredClone API as a more reliable solution.

JSONJavaScriptcircular reference
0 likes · 5 min read
Why JSON.parse(JSON.stringify(obj)) Fails for Deep Cloning and Better Alternatives
Deepin Linux
Deepin Linux
Nov 30, 2025 · Fundamentals

When Does C++ Generate a Default Copy Constructor? A Deep Dive

This article explains the role of copy constructors in C++, when the compiler automatically provides a default one, the situations that trigger copy construction, why bitwise copying can be unsafe, and how to implement proper deep‑copy semantics with clear code examples.

Copy ConstructorDefault ConstructorInheritance
0 likes · 31 min read
When Does C++ Generate a Default Copy Constructor? A Deep Dive
Deepin Linux
Deepin Linux
Aug 22, 2025 · Fundamentals

When Does C++ Generate a Default Copy Constructor? Deep Dive and Pitfalls

This article explains what a copy constructor is, when the C++ compiler automatically generates a default copy constructor, and why relying on shallow copying can cause serious bugs, especially with inheritance, virtual functions, and resource‑managing members.

Copy ConstructorDefault Constructorc++
0 likes · 39 min read
When Does C++ Generate a Default Copy Constructor? Deep Dive and Pitfalls
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Jun 22, 2017 · Frontend Development

Mastering Deep vs Shallow Cloning in JavaScript and jQuery

This article explains the difference between deep and shallow cloning in JavaScript, illustrates how reference types affect object copies, demonstrates practical implementations using loops, Array.concat, and jQuery.extend, and shows visual examples to help developers avoid common pitfalls when merging objects.

Shallow Clonedeep clonefrontend
0 likes · 4 min read
Mastering Deep vs Shallow Cloning in JavaScript and jQuery