<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vimal Tripathi</title>
    <description>The latest articles on DEV Community by Vimal Tripathi (@vimal_tripathi).</description>
    <link>https://dev.to/vimal_tripathi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3326090%2F5bc00190-c3a9-4012-ad27-510eb9ad2a8c.jpg</url>
      <title>DEV Community: Vimal Tripathi</title>
      <link>https://dev.to/vimal_tripathi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vimal_tripathi"/>
    <language>en</language>
    <item>
      <title>Shallow Copy vs Deep Copy in JavaScript</title>
      <dc:creator>Vimal Tripathi</dc:creator>
      <pubDate>Sun, 06 Jul 2025 09:43:13 +0000</pubDate>
      <link>https://dev.to/vimal_tripathi/shallow-copy-vs-deep-copy-in-javascript-3pfl</link>
      <guid>https://dev.to/vimal_tripathi/shallow-copy-vs-deep-copy-in-javascript-3pfl</guid>
      <description>&lt;p&gt;When working with objects and arrays in JavaScript, developers often run into unexpected behavior because of how copies work. A major confusion is between shallow copy and deep copy.&lt;/p&gt;

&lt;p&gt;🟠 What is a Shallow Copy?&lt;br&gt;
Imagine you copy a room — it looks exactly the same: same walls, same furniture, same cupboard.&lt;br&gt;
But here’s the catch — the cupboard inside is shared.&lt;br&gt;
If you change something inside the cupboard in one room, it also changes in the other!&lt;/p&gt;

&lt;p&gt;That’s what a shallow copy does.&lt;/p&gt;

&lt;p&gt;const original = {&lt;br&gt;
  name: "Vimal",&lt;br&gt;
  skills: {&lt;br&gt;
    frontend: "React",&lt;br&gt;
    backend: "Node"&lt;br&gt;
  }&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;const shallow = { ...original };&lt;br&gt;
shallow.skills.frontend = "Vue";&lt;/p&gt;

&lt;p&gt;console.log(original.skills.frontend); // Output: "Vue" ❌&lt;/p&gt;

&lt;p&gt;🟢 What is a Deep Copy?&lt;br&gt;
Now imagine you not only copy the room but also build a completely new cupboard with its own items.&lt;br&gt;
Now, if you change something inside this cupboard, it won’t affect the original.&lt;/p&gt;

&lt;p&gt;That’s a deep copy in JavaScript.&lt;/p&gt;

&lt;p&gt;const deep = JSON.parse(JSON.stringify(original));&lt;br&gt;
deep.skills.frontend = "Angular";&lt;br&gt;
console.log(original.skills.frontend); // Output: "React" ✅&lt;/p&gt;

&lt;p&gt;Here, deep is fully independent — changes inside don’t affect the original.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is React?</title>
      <dc:creator>Vimal Tripathi</dc:creator>
      <pubDate>Sat, 05 Jul 2025 15:23:52 +0000</pubDate>
      <link>https://dev.to/vimal_tripathi/what-is-react-4dpf</link>
      <guid>https://dev.to/vimal_tripathi/what-is-react-4dpf</guid>
      <description>&lt;p&gt;React is an open-source front-end JavaScript library that helps in building reusable components and provides the view layer for web and mobile applications.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
