Rohit Rairohitrai.hashnode.dev·Aug 23, 2024Understanding Deep Copy vs. Shallow Copy in Python: Key Differences and Practical ExamplesDifference between deep copy and shallow copy in Python Introduction In Python programming, the concept of copying objects is crucial, especially when dealing with mutable data types like lists and dictionaries. Understanding how copying works and th...Discuss·27 readsPython
Avinash Dewanganavidew.hashnode.dev·Aug 6, 2024How to create Shallow and Deep copy in JavaScript//create Object let object = { name : "ravi", age : "36" } // shallow copy let ShallowCopy = object //ShallowCopy changes age 35 ShallowCopy.age=35 // print shallow copy and object reflect both object console.log("ShallowcCopy : ", ShallowCopy) conso...DiscussDeepCopy
Niharika Gurnaniniharikagurnani.hashnode.dev·May 30, 2024Deep Copy vs Shallow copy"Knowingly or unknowingly, since we all know JS in unpredictable, we end up modifying the existing data in JS objects / variables. To prevent this, we must ensure to safely copy the data." By simply using the = (assignment) operator, we end up copyin...Discuss·28 readsDeepCopy
Behnam Amiribehnam-amiri.hashnode.dev·May 20, 2024From Shallow to Deep: A Comprehensive Guide to JavaScript Data Duplication for Arrays and ObjectsIntroduction Let's quickly review data types in JavaScript. In JavaScript, data types are broadly categorized into two categories: primitive and non-primitive.Primitive data types are the predefined data types provided by the JavaScript language. The...Discuss·1 like·49 readsData Duplication
Arturcode-with-arthur.hashnode.dev·May 9, 2024The Importance of Immutability in Programming: Why It Matters?A lot of folks starting out with JavaScript and programming, in general, often encounter the idea of immutability and its importance. But why is it so crucial? And why does it matter? What exactly is immutability and an immutable value? Immutable mea...DiscussProgramming Best Practices
Manas Upadhyaymanasupadhyay.hashnode.dev·Mar 21, 2024Shallow Copy vs Deep CopyWhen working with objects and arrays in JavaScript, understanding the concepts of shallow copy and deep copy is crucial for effective programming and avoiding unexpected bugs. In this article, we'll delve into what shallow copy and deep copy mean, th...Discuss·13 likes·58 readsJavaScriptJavaScript
Saurabh vermaedunode.hashnode.dev·Mar 3, 2024Deep Copy and Shallow CopyOne of the most important concept in java-script When you are dealing with java-script objects. understanding the concepts of shallow copy and deep copy is crucial to avoid unintended side effects and unexpected behavior in your code. 1. Copying Prim...Discuss·3 likesJavaScript
Jaydev Jadavtechjaydev.hashnode.dev·Feb 11, 2024JavaScript's Object Copy Puzzle: Shallow vs Deep?In the JavaScript world, you often experience some strange behaviour. One such quirk that frequently confounds developers is the Object Copy Problem. In the wild and woolly realm of JavaScript, you may encounter some rather peculiar phenomena. Pictur...Discuss·10 likes·73 readsJavascriptJavaScript
vishal singhvishal21121.hashnode.dev·Dec 19, 2023Shallow copy vs Deep copyWhen dealing with arrays and objects in JavaScript, it is often necessary to create copies of these structures. Since both arrays and objects are mutable, understanding the implications of modifying a copied array or object on the original is crucial...DiscussJavaScript# shallow copy vs Deep copy
zhioua mohamedmohamedzhioua.hashnode.dev·Oct 6, 2023Shallow Copies vs. Deep Copies in JavaScript: When to Use EachTable of contents Introduction Shallow copies Deep copies Spread syntax Deep copying objects JSON.stringify() and JSON.parse() structuredClone() Conclusion Introduction When copying objects in JavaScript, it is important to understand the...Discuss·51 readsJavaScriptJavaScript