<?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: khushal jangid</title>
    <description>The latest articles on DEV Community by khushal jangid (@khushal_jangid_aecb6739f4).</description>
    <link>https://dev.to/khushal_jangid_aecb6739f4</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3695577%2F246cb5d3-203e-457a-a736-a212d4dbedd8.png</url>
      <title>DEV Community: khushal jangid</title>
      <link>https://dev.to/khushal_jangid_aecb6739f4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khushal_jangid_aecb6739f4"/>
    <language>en</language>
    <item>
      <title>Feel Fear After Doing Something Difficult</title>
      <dc:creator>khushal jangid</dc:creator>
      <pubDate>Tue, 23 Jun 2026 16:19:49 +0000</pubDate>
      <link>https://dev.to/khushal_jangid_aecb6739f4/feel-fear-after-doing-something-difficult-504o</link>
      <guid>https://dev.to/khushal_jangid_aecb6739f4/feel-fear-after-doing-something-difficult-504o</guid>
      <description>&lt;h2&gt;
  
  
  Why Do We Feel Fear After Doing Something Difficult?
&lt;/h2&gt;

&lt;p&gt;Feeling afraid after completing a difficult task is a common response of the human brain. There are several reasons behind it.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Brain Is Afraid of Uncertainty 🧠
&lt;/h3&gt;

&lt;p&gt;When we do something new or challenging, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building a React project for the first time&lt;/li&gt;
&lt;li&gt;Solving a difficult DSA problem&lt;/li&gt;
&lt;li&gt;Giving an interview&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;the brain starts thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What will happen next? Will I succeed?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The human brain tries to predict the future. When something is unknown, it creates a feeling of fear because the outcome is uncertain.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Stress Release After Completing a Challenge
&lt;/h3&gt;

&lt;p&gt;During a difficult task, our body enters a focused mode.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;You study DSA for 3 hours and finally solve a problem.&lt;/p&gt;

&lt;p&gt;During that time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your mind is fully focused&lt;/li&gt;
&lt;li&gt;Your body handles pressure&lt;/li&gt;
&lt;li&gt;Your brain stays alert&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After finishing, the stress reduces and the brain starts processing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Will I remember this?"&lt;/li&gt;
&lt;li&gt;"Will I be able to solve similar problems?"&lt;/li&gt;
&lt;li&gt;"What if I fail later?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This can create fear or anxiety.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Fear Is Often a Sign of Growth
&lt;/h3&gt;

&lt;p&gt;Whenever we move outside our comfort zone, we enter a learning phase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Comfort Zone
      |
      ↓
Learning Zone
      |
      ↓
Fear Zone
      |
      ↓
Growth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Doing something challenging means you are entering a new area where your brain has less experience.&lt;/p&gt;

&lt;p&gt;That unfamiliarity creates fear.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. The Brain Creates Future Scenarios
&lt;/h3&gt;

&lt;p&gt;The brain does not only focus on the present. It also imagines future situations.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;You learn Express.js today.&lt;/p&gt;

&lt;p&gt;Your brain may think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What if an interviewer asks this?"&lt;/li&gt;
&lt;li&gt;"What if I forget the concept?"&lt;/li&gt;
&lt;li&gt;"Am I learning correctly?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The brain creates possible future situations to prepare you.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Important Point
&lt;/h2&gt;

&lt;p&gt;Fear does not always mean you are not capable.&lt;/p&gt;

&lt;p&gt;Many times, fear means the task is important and your brain is taking it seriously.&lt;/p&gt;

&lt;p&gt;With practice, your brain collects evidence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I can handle this."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then the fear gradually decreases.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First LeetCode problem → Fear&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After solving many problems → Patterns become familiar&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;First React project → Confusion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After building multiple projects → Architecture becomes clearer&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Growth often happens when we continue even while feeling uncertain.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>mentalhealth</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Mutating state | Immutating state</title>
      <dc:creator>khushal jangid</dc:creator>
      <pubDate>Tue, 23 Jun 2026 05:19:51 +0000</pubDate>
      <link>https://dev.to/khushal_jangid_aecb6739f4/mutating-state-immutating-state-1ik1</link>
      <guid>https://dev.to/khushal_jangid_aecb6739f4/mutating-state-immutating-state-1ik1</guid>
      <description>&lt;p&gt;Your confusion is coming from mixing JavaScript objects + mutation + React-style immutability concepts. Let’s clear it step by step.&lt;/p&gt;

&lt;p&gt;🧠 1. First fix your code (syntax)&lt;/p&gt;

&lt;p&gt;You wrote:&lt;/p&gt;

&lt;p&gt;let state ={&lt;br&gt;
count:0;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Correct:&lt;/p&gt;

&lt;p&gt;let state = {&lt;br&gt;
  count: 0&lt;br&gt;
};&lt;br&gt;
🔥 2. What is happening in your code (MUTATION)&lt;br&gt;
Code:&lt;br&gt;
let state = {&lt;br&gt;
  count: 0&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;state.count = 1;&lt;/p&gt;

&lt;p&gt;console.log(state);&lt;br&gt;
👉 Meaning:&lt;/p&gt;

&lt;p&gt;You directly changed the object.&lt;/p&gt;

&lt;p&gt;This is called mutation.&lt;/p&gt;

&lt;p&gt;Memory idea:&lt;/p&gt;

&lt;p&gt;state → { count: 0 }&lt;/p&gt;

&lt;p&gt;After mutation:&lt;/p&gt;

&lt;p&gt;state → { count: 1 }&lt;/p&gt;

&lt;p&gt;So object is SAME, only value inside changed.&lt;/p&gt;

&lt;p&gt;🧠 3. Your function (mutation again)&lt;br&gt;
function increment() {&lt;br&gt;
  state.count = state.count + 1;&lt;br&gt;
}&lt;br&gt;
What happens:&lt;br&gt;
Before:&lt;br&gt;
state = { count: 1 }&lt;br&gt;
After calling increment():&lt;br&gt;
state = { count: 2 }&lt;/p&gt;

&lt;p&gt;Again:&lt;br&gt;
👉 SAME object, just modified inside&lt;/p&gt;

&lt;p&gt;This is called:&lt;/p&gt;

&lt;p&gt;🔴 Mutation (changing original state)&lt;/p&gt;

&lt;p&gt;❓ Why console shows undefined sometimes?&lt;/p&gt;

&lt;p&gt;If you do:&lt;/p&gt;

&lt;p&gt;console.log(increment());&lt;/p&gt;

&lt;p&gt;Function returns nothing → so output is:&lt;/p&gt;

&lt;p&gt;undefined&lt;/p&gt;

&lt;p&gt;Because you did not return anything.&lt;/p&gt;

&lt;p&gt;🚀 4. IMMUTABLE version (VERY IMPORTANT CONCEPT)&lt;/p&gt;

&lt;p&gt;You wrote:&lt;/p&gt;

&lt;p&gt;{ count: state.count + 1 }&lt;/p&gt;

&lt;p&gt;This is NOT mutation.&lt;/p&gt;

&lt;p&gt;This creates a NEW object.&lt;/p&gt;

&lt;p&gt;🧠 Mutation vs Immutability&lt;br&gt;
🔴 Mutation (old object modified)&lt;br&gt;
state.count = state.count + 1;&lt;br&gt;
same object&lt;br&gt;
memory same&lt;br&gt;
risky in React/Redux&lt;br&gt;
🟢 Immutability (new object created)&lt;br&gt;
state = { count: state.count + 1 };&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;state → { count: 1 }&lt;/p&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;p&gt;state → { count: 2 } (NEW object)&lt;/p&gt;

&lt;p&gt;👉 Old object is NOT changed&lt;/p&gt;

&lt;p&gt;🎯 5. Why immutability is important (React mindset)&lt;/p&gt;

&lt;p&gt;React depends on:&lt;/p&gt;

&lt;p&gt;“Did object reference change?”&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;p&gt;Mutation ❌&lt;br&gt;
state.count++;&lt;/p&gt;

&lt;p&gt;React may NOT detect change properly&lt;/p&gt;

&lt;p&gt;Immutability ✅&lt;br&gt;
setState({ count: state.count + 1 });&lt;/p&gt;

&lt;p&gt;React sees:&lt;/p&gt;

&lt;p&gt;new object&lt;br&gt;
re-render happens&lt;br&gt;
🧠 Simple analogy&lt;br&gt;
Mutation:&lt;/p&gt;

&lt;p&gt;You repaint same house 🏠&lt;/p&gt;

&lt;p&gt;Immutability:&lt;/p&gt;

&lt;p&gt;You build new house 🏡&lt;/p&gt;

&lt;p&gt;🔥 6. Final clean understanding&lt;br&gt;
Concept Meaning&lt;br&gt;
Mutation    change same object&lt;br&gt;
Immutability    create new object&lt;br&gt;
state.count++   mutation&lt;br&gt;
{count: state.count+1}  new object&lt;br&gt;
⚡ One-line memory trick&lt;/p&gt;

&lt;p&gt;Mutation = “same object, change inside”&lt;br&gt;
Immutability = “new object, old unchanged”&lt;/p&gt;

&lt;p&gt;If you want, I can explain this with &lt;br&gt;
React useState example + interview trick + real DOM re-render story (very important for interviews).&lt;/p&gt;

&lt;p&gt;explain this for writing blog&lt;/p&gt;

&lt;p&gt;Here’s a clean blog-style explanation you can directly use or adapt.&lt;/p&gt;

&lt;p&gt;🧠 Mutation vs Immutability in JavaScript (Simple Explanation)&lt;/p&gt;

&lt;p&gt;When working with JavaScript objects, especially in frameworks like React, you will often hear two important terms:&lt;/p&gt;

&lt;p&gt;Mutation and Immutability&lt;/p&gt;

&lt;p&gt;These concepts decide how data changes in your application and how efficiently your UI updates.&lt;/p&gt;

&lt;p&gt;Let’s understand them in a very simple way.&lt;/p&gt;

&lt;p&gt;📦 1. What is an Object in JavaScript?&lt;/p&gt;

&lt;p&gt;In JavaScript, objects are stored in memory like this:&lt;/p&gt;

&lt;p&gt;let state = {&lt;br&gt;
  count: 0&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;Here, state is not the actual data. It is a reference pointing to the object in memory.&lt;/p&gt;

&lt;p&gt;🔴 2. Mutation (Changing the Same Object)&lt;/p&gt;

&lt;p&gt;Mutation means modifying the original object directly.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
let state = {&lt;br&gt;
  count: 0&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;state.count = 1;&lt;/p&gt;

&lt;p&gt;console.log(state);&lt;br&gt;
What is happening?&lt;br&gt;
We are changing the value inside the same object&lt;br&gt;
No new object is created&lt;br&gt;
Memory reference stays the same&lt;br&gt;
Visualization:&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;state → { count: 0 }&lt;/p&gt;

&lt;p&gt;After mutation:&lt;/p&gt;

&lt;p&gt;state → { count: 1 }&lt;/p&gt;

&lt;p&gt;👉 Same object, just updated inside&lt;/p&gt;

&lt;p&gt;⚠️ Problem with mutation&lt;/p&gt;

&lt;p&gt;Mutation can create issues in frameworks like React because:&lt;/p&gt;

&lt;p&gt;The reference does NOT change&lt;br&gt;
React may not detect updates properly&lt;br&gt;
UI updates can become unpredictable&lt;br&gt;
🟢 3. Immutability (Creating a New Object)&lt;/p&gt;

&lt;p&gt;Immutability means not changing the original object, but creating a new one with updated values.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
let state = {&lt;br&gt;
  count: 0&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;state = {&lt;br&gt;
  count: state.count + 1&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;console.log(state);&lt;br&gt;
What is happening?&lt;br&gt;
A new object is created&lt;br&gt;
Old object remains unchanged&lt;br&gt;
Reference changes&lt;br&gt;
Visualization:&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;p&gt;state → { count: 0 }&lt;/p&gt;

&lt;p&gt;After immutability:&lt;/p&gt;

&lt;p&gt;old state → { count: 0 }&lt;br&gt;
new state → { count: 1 }&lt;/p&gt;

&lt;p&gt;👉 Completely new object is created&lt;/p&gt;

&lt;p&gt;⚖️ 4. Mutation vs Immutability (Key Difference)&lt;br&gt;
Feature Mutation    Immutability&lt;br&gt;
Object change   Same object New object&lt;br&gt;
Memory  Same reference  New reference&lt;br&gt;
Safety  Risky in large apps Safe and predictable&lt;br&gt;
React behavior  May not re-render   Always triggers update&lt;br&gt;
🚀 5. Why React Prefers Immutability&lt;/p&gt;

&lt;p&gt;React depends on detecting changes using reference comparison:&lt;/p&gt;

&lt;p&gt;If object reference changes → React re-renders UI&lt;/p&gt;

&lt;p&gt;So this works well:&lt;/p&gt;

&lt;p&gt;setState({ count: state.count + 1 });&lt;/p&gt;

&lt;p&gt;But this can fail:&lt;/p&gt;

&lt;p&gt;state.count++;&lt;/p&gt;

&lt;p&gt;Because React may not detect the change properly.&lt;/p&gt;

&lt;p&gt;🧠 6. Simple Real-Life Analogy&lt;br&gt;
Mutation:&lt;/p&gt;

&lt;p&gt;You edit the same notebook page ✏️&lt;br&gt;
Everything changes in place.&lt;/p&gt;

&lt;p&gt;Immutability:&lt;/p&gt;

&lt;p&gt;You write a new page 📄&lt;br&gt;
Old page stays unchanged.&lt;/p&gt;

&lt;p&gt;🎯 7. Final Summary&lt;br&gt;
Mutation = change the same object&lt;br&gt;
Immutability = create a new object&lt;br&gt;
React prefers immutability for predictable updates&lt;br&gt;
Good developers avoid mutation in state handling&lt;br&gt;
🔥 One-line takeaway&lt;/p&gt;

&lt;p&gt;“Mutation changes data in place, immutability creates a new version of data without touching the original.”&lt;/p&gt;

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