<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Mudassar Bhatti]]></title><description><![CDATA[Mudassar Bhatti]]></description><link>https://mudassarbhatti.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 12:10:26 GMT</lastBuildDate><atom:link href="https://mudassarbhatti.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Day 5: Where Do Variables Actually Live?]]></title><description><![CDATA[Day 5. Today's topic sounded boring when sir said it: "stack and heap memory." I almost zoned out. Then ten minutes later I was staring at my screen going "WAIT, that's allowed?!"
I'm learning JavaScr]]></description><link>https://mudassarbhatti.hashnode.dev/day-5-where-do-variables-actually-live</link><guid isPermaLink="true">https://mudassarbhatti.hashnode.dev/day-5-where-do-variables-actually-live</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[webdev]]></category><category><![CDATA[#LearninPublic]]></category><dc:creator><![CDATA[Mudassar Ali]]></dc:creator><pubDate>Wed, 07 Oct 2026 12:29:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/a0986b5f-fa12-4d6f-b934-f2a166068702.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Day 5. Today's topic sounded boring when sir said it: "stack and heap memory." I almost zoned out. Then ten minutes later I was staring at my screen going "WAIT, that's allowed?!"</p>
<p>I'm learning JavaScript in my web development course, and today we went UNDER the hood — where does JavaScript actually KEEP your variables?</p>
<h2>Two neighborhoods in your RAM</h2>
<p>Your computer's memory (RAM — sir even wrote "4 GB Ram" on the board) has two neighborhoods, and JavaScript uses both:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/3e1ae841-a7ba-49fd-bcf8-95e5787572ab.png" alt="" style="display:block;margin:0 auto" />

<p><strong>The Stack</strong> is like your work desk. Small, organized, fast. This is where JavaScript keeps the simple stuff — primitives. Numbers, strings, booleans. The actual VALUE sits right there on the desk.</p>
<p><strong>The Heap</strong> is like a warehouse. Big, spacious, a bit messy. This is where the complicated stuff lives — objects, arrays, functions. But here's the twist: your variable doesn't hold the object. It holds the ADDRESS of the object. Like a slip of paper that says "go to warehouse shelf 6382."</p>
<p>The internet's best analogy for this (and I'm stealing it): it's like a house address. The house is the actual object sitting in the heap. The address written on paper is the reference your variable holds. And if two people have the SAME address written down? They both walk into the same house.</p>
<p>Remember that. It's about to matter a lot.</p>
<h2>Copy by value: the photocopy</h2>
<p>Let's start with the well-behaved case. Real code from my practice file:</p>
<pre><code class="language-js">let a = 10;
let b = a;
b = 30;
console.log(b);  // 30
console.log(a);  // 10
</code></pre>
<p><code>let b = a</code> — you'd think b and a are now linked, right? Nope. With primitives, JavaScript makes a PHOTOCOPY. b gets its own independent copy of 10. Then b becomes 30, and a just sits there at 10, completely unbothered.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/abfb2f29-44b3-4ef8-b66c-ffa884f15691.png" alt="" style="display:block;margin:0 auto" />

<p>One more word from class: primitives are <strong>IMMUTABLE</strong>. Fancy word, simple meaning — the value itself can't be changed, only replaced. When you write <code>a = 20</code>, JavaScript doesn't edit the 10. It throws it away and puts 20 in its place. Like replacing a sugar cube, not reshaping it. (Sir literally drew sugar cubes on the board. I have the notebook to prove it.)</p>
<h2>Copy by reference: the shared Google Doc</h2>
<p>Now the same idea, but with an object. Same practice file:</p>
<pre><code class="language-js">let obj1 = {
    id: 20,
    name: "rohit"
};

let obj2 = obj1;
obj2.id = 30;

console.log(obj1);  // { id: 30, name: "rohit" }
console.log(obj2);  // { id: 30, name: "rohit" }
</code></pre>
<p>Read that output again. I changed obj2. But obj1 ALSO changed. I did NOT touch obj1!</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/1c6b609a-385e-40dd-b09d-229db1a1cf46.png" alt="" style="display:block;margin:0 auto" />

<p>That's the exact face I made.</p>
<p>Here's what happened, watch it unfold:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/4a10fef7-ccf8-44de-ae5b-4602908ff291.gif" alt="" style="display:block;margin:0 auto" />

<p><code>let obj2 = obj1</code> did NOT copy the object. It copied the ADDRESS. Now obj1 and obj2 both hold "@6382" — two slips of paper with the same warehouse address. There's still only ONE object in the heap.</p>
<p>So <code>obj2.id = 30</code> walks into that one shared object and changes it. Then when you ask obj1 what's in there — surprise, it's 30 too. Because it's the same object!</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/801df56a-873c-42f5-9995-6647f3e9c510.png" alt="" style="display:block;margin:0 auto" />

<p>The internet's perfect analogy: it's a shared Google Doc link. A photocopy (primitives) — you scribble on your copy, the original is fine. A shared doc link (objects) — you edit the doc, EVERYONE with the link sees the change. obj1 and obj2 both have the link.</p>
<h2>Why should you care?</h2>
<p>Because this bug has ended careers. Okay, slight exaggeration. But barely.</p>
<p>Imagine you're building a shopping cart. You copy the cart to make a "backup"... then the user removes an item from the real cart... and your backup loses it too. Because it was never a backup. It was the same cart with two names.</p>
<p>This is THE classic beginner bug. Now you know it exists before it bites you. You're welcome.</p>
<p>The fix? There are ways to make a REAL copy (spread operator and friends are coming on a future day). For today, just remember the rule:</p>
<p><strong>Primitives → copied by value. Objects → copied by reference.</strong></p>
<p>Or even shorter, straight from my notebook: "Primitive = copy milta hai. Non-primitive = reference milta hai."</p>
<hr />
<p>Tomorrow: wherever day 6 takes us. The deeper we go, the more interesting it gets. See you there.</p>
]]></content:encoded></item><item><title><![CDATA[Day 4: Equality? In JavaScript?!]]></title><description><![CDATA[So. Day 4. I walked in thinking I understood what "equal" means. I've been using the word "equal" my entire life. Turns out JavaScript and I have very different definitions.
I'm learning through my we]]></description><link>https://mudassarbhatti.hashnode.dev/day-4-equality-in-javascript</link><guid isPermaLink="true">https://mudassarbhatti.hashnode.dev/day-4-equality-in-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[webdev]]></category><category><![CDATA[#LearninPublic]]></category><dc:creator><![CDATA[Mudassar Ali]]></dc:creator><pubDate>Mon, 05 Oct 2026 14:20:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/2aaa841e-296d-49f5-801a-fc7450d4cfa8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So. Day 4. I walked in thinking I understood what "equal" means. I've been using the word "equal" my entire life. Turns out JavaScript and I have very different definitions.</p>
<p>I'm learning through <strong>my web development course</strong>, and today sir looked at us and said "<code>==</code> vs <code>===</code>." Just like that. Like it was nothing. It was not nothing.</p>
<h2>The loose friend and the strict bouncer</h2>
<p>JavaScript has TWO ways to ask "are these equal?" And they do not agree.</p>
<pre><code class="language-js">10 == "10"    // true
10 === "10"   // false
</code></pre>
<p>Same values. Different answers. Why?</p>
<p>Because <code>==</code> — the loose friend — looks at the number 10 and the string "10" and goes "eh, close enough." It quietly converts the string into a number first, THEN compares. Bends the rules to make things work.</p>
<p><code>===</code> — the strict bouncer — checks your ID first. Number? String? Different species? "Not equal. Next." No conversion. No compromises. No mercy.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/b7fa711f-a4ef-4ce8-b165-528ce0ed1025.png" alt="" style="display:block;margin:0 auto" />

<p>The internet's simplest rule, and I'm stealing it: use <code>===</code>. Always. Unless you have a very specific reason not to. <code>==</code> is that friend who tries too hard — and in code, trying too hard creates bugs at 3 AM.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/194fe60a-9aa0-46a0-8955-e0023c9b8b64.png" alt="" style="display:block;margin:0 auto" />

<p><em>Patrick discovering that</em> <code>0 == "0"</code> <em>is true. We've all been Patrick. (via josefczech.cz)</em></p>
<h2>The null circus</h2>
<p>Okay. Remember null and undefined from day 2? The twins? Today they put on a whole circus. Real outputs from my practice file — I'm not making any of this up:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/a5710371-88ce-4d6b-be04-29fafcd7c334.png" alt="" style="display:block;margin:0 auto" />

<pre><code class="language-js">null == undefined    // true
null === undefined   // false
</code></pre>
<p>Equal... but not identical. Like celebrity lookalikes. The loose friend says "same thing!" The strict bouncer says "different species, get out."</p>
<p>But wait, it gets worse:</p>
<pre><code class="language-js">null == 0    // false
null &gt; 0     // false
null &gt;= 0    // true?!
</code></pre>
<p>Read that again slowly. null is NOT equal to 0. null is NOT greater than 0. But null IS greater-than-or-equal to 0.</p>
<p>Pick a lane, null.</p>
<p>The explanation (because I needed one too): <code>&gt;=</code> secretly converts null to 0 first, so it becomes <code>0 &gt;= 0</code> — true. But <code>==</code> has a special rule: null only loosely equals undefined, nothing else. So <code>null == 0</code> stays false. It's not random. It's just... rules written by different people who never met each other.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/2866d1c4-654b-4662-8c42-228233396b43.gif" alt="" style="display:block;margin:0 auto" />

<p>And undefined? undefined looked at all of this and said "nah, I'm out":</p>
<pre><code class="language-js">undefined == 0   // false
undefined &lt; 0    // false
undefined &gt; 0    // false
undefined &lt;= 0   // false
undefined &gt;= 0   // false
</code></pre>
<p>ALL false. undefined simply refuses to participate in mathematics. Honestly? Respect.</p>
<h2>NaN: the identity crisis</h2>
<pre><code class="language-js">NaN == NaN   // false
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/01cca428-3d75-46ad-86fb-df213bb2ed0d.png" alt="" style="display:block;margin:0 auto" />

<p>NaN isn't even equal to ITSELF. Imagine looking in the mirror and the mirror goes "nah, that's not you." That's NaN's entire life. The ultimate identity crisis.</p>
<p>Oh, and one more — chains betray you:</p>
<pre><code class="language-js">123 == "123" == 123   // false?!
</code></pre>
<p>JavaScript reads left to right: <code>123 == "123"</code> becomes true (loose friend converts). Then <code>true == 123</code> becomes false (true becomes 1, and 1 is not 123). The chain breaks at the last link. I hate it here.</p>
<h2>The decision makers</h2>
<p>After all that chaos, logical operators felt like a cold drink of water. These are the symbols that make DECISIONS:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/dd77551d-ad48-41a3-96cb-d485a8aaab26.png" alt="" style="display:block;margin:0 auto" />

<pre><code class="language-js">age &lt; 18 &amp;&amp; money &gt; 200   // BOTH must be true
age &gt; 10 || money &gt; 200   // ONE true is enough
!(age &gt; 10)               // the contrarian — flips it
</code></pre>
<p><code>&amp;&amp;</code> is a door with two locks — you need both keys. <code>||</code> is a door where either key works. And <code>!</code> just disagrees with everything. We all know someone like <code>!</code>.</p>
<p>You'll use these everywhere. Every "if this AND that" in every app ever — that's <code>&amp;&amp;</code> doing its job.</p>
<h2>Bonus: binary wizardry</h2>
<p>And then, at the end of class, sir casually dropped bitwise operators on us. These work on the actual 1s and 0s:</p>
<pre><code class="language-js">4 &amp; 5    // 4
11 | 14  // 15
5 ^ 7    // 2
</code></pre>
<p>But the cool ones are the shifters:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/b687e0f5-1739-4bfc-a8e5-d29b04dd45c8.png" alt="" style="display:block;margin:0 auto" />

<pre><code class="language-js">5 &lt;&lt; 3    // 40
</code></pre>
<p>Take 5, which is <code>101</code> in binary. Shove all the bits 3 places left: <code>101000</code>. That's 40. Shifting left = multiplying by 2, three times. And <code>20 &gt;&gt; 2</code> = 5 — shove right = divide.</p>
<p>My notes literally have the binary written out: 101 becomes 101000. Chef's kiss. I felt like a hacker again.</p>
<hr />
<p>Sir left us homework: figure out what <code>undefined != null</code> gives. I'm not telling you. Go try it in your console — that's the whole point of this series. We learn by breaking things.</p>
<p>Tomorrow: wherever day 5 takes us. See you there.</p>
]]></content:encoded></item><item><title><![CDATA[Day 3: The Day JavaScript Started Acting Weird]]></title><description><![CDATA[Alright, day 3. Let me be honest with you — the first two days I felt smart. Like "oh, this coding thing isn't so bad." Day 3 humbled me.
I'm learning through my web development course, and today sir ]]></description><link>https://mudassarbhatti.hashnode.dev/day-3-the-day-javascript-started-acting-weird</link><guid isPermaLink="true">https://mudassarbhatti.hashnode.dev/day-3-the-day-javascript-started-acting-weird</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[webdev]]></category><category><![CDATA[#LearninPublic]]></category><dc:creator><![CDATA[Mudassar Ali]]></dc:creator><pubDate>Mon, 05 Oct 2026 13:29:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/16b6fb45-ca58-48c6-99ec-a128a3141c79.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Alright, day 3. Let me be honest with you — the first two days I felt smart. Like "oh, this coding thing isn't so bad." Day 3 humbled me.</p>
<p>I'm learning through <strong>my web development course</strong>, and today sir basically said "remember those simple boxes? Forget simple." And introduced the complicated family.</p>
<h2>Boxes that hold... everything?</h2>
<p>So far every variable held ONE thing. One number. One string. Done.</p>
<p>Then sir wrote this:</p>
<pre><code class="language-js">let arr = [10, 20, 50, "ali", "mohit"];
</code></pre>
<p>Numbers AND names. In the same box. Together. My first thought was "wait, that's allowed??" Turns out yes. It's called an <strong>Array</strong> — just a list, in order. Like a train. Every bogie has a number, bogies stay in order.</p>
<p>Except — and this is where I laughed out loud — programmers count from zero. The FIRST bogie is bogie number 0. I don't know who decided this. I just work here.</p>
<p>Then sir did this:</p>
<pre><code class="language-js">console.log(typeof arr);   // "object"
</code></pre>
<p>I stared at my screen. An array... is an object? Sir just smiled. "Arrays are objects wearing a trench coat." Okay sir. Okay.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/b7df4af8-5cb0-48ee-9aec-8639b45f4f70.png" alt="Non-primitive data types diagram: Array, Object, Function" style="display:block;margin:0 auto" />

<p>Then came <strong>Objects</strong> (capital O, different thing). Instead of numbered bogies, every value gets a name tag:</p>
<pre><code class="language-js">let obj = { user_name: "Ali", account_number: 31242314213, balance: 420 };
</code></pre>
<p>This one actually made sense to me immediately. It's like a form. Name: Ali. Account number: that. Balance: 420. You want the balance? Ask for it by name. No counting bogies.</p>
<p>And <strong>Functions</strong> — I'll be real with you, we only touched these. A function is a recipe you write once and reuse. Like instead of explaining how to make chai every single time, you write it down once and just say "make chai." We'll go deep later. Today was already a lot.</p>
<h2>The part where JavaScript lies to you</h2>
<p>Okay so. Yesterday we learned values have "species." Today I learned JavaScript secretly converts one species into another when you're not looking. It's called <strong>type conversion</strong>. Or coercion, which is just a fancy word for converting.</p>
<p>Sometimes you ask for it:</p>
<pre><code class="language-js">Number("100")   // 100. Fair. The text "100" becomes the number 100.
</code></pre>
<p>And sometimes JavaScript just... decides:</p>
<pre><code class="language-js">Number("100xs")   // NaN
</code></pre>
<p><strong>NaN</strong> means "Not a Number." It's what JavaScript gives you when it tries to do math and fails. It's basically JavaScript throwing its hands up going "I don't know, man."</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/de5db7f8-50dd-4b05-8825-70896f2a6148.png" alt="Type conversion coercion table diagram" style="display:block;margin:0 auto" />

<p>Look at this list. Really look at it.</p>
<p><code>Number(null)</code> gives 0. So "nothing" equals zero. Fine.</p>
<p><code>Number(undefined)</code> gives NaN. So "not defined" breaks math entirely.</p>
<p>And my personal favorite — <code>Boolean(" ")</code> is <strong>true</strong>. That's a single SPACE. Invisible. Nothing you can see. And JavaScript goes "yep, that's truthy." Meanwhile my motivation on Monday mornings? Falsy.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/6e57fcdc-4569-423f-99b3-f14e91ca8fb9.gif" alt="Mind blown exploding head emoji GIF" style="display:block;margin:0 auto" />

<p>I found the clearest explanation of all this on Reddit and dev.to, and it clicked for me instantly, so here it is: the <code>+</code> sign has two personalities. If there's a string anywhere near it, <code>+</code> becomes GLUE. It just sticks things together:</p>
<pre><code class="language-js">"2" + "2"   // "22" — glue, not math
</code></pre>
<p>But <code>-</code> only knows math. Which gives us the legendary:</p>
<pre><code class="language-js">"2" + "2" - "2"   // 20
</code></pre>
<p>Go left to right. <code>"2"+"2"</code> becomes <code>"22"</code> (glue). Then <code>"22"-"2"</code> — JavaScript panics, converts both to numbers — <code>22-2</code> — <code>20</code>.</p>
<p>This exact thing is a famous meme on r/ProgrammerHumor. Thousands of people have stared at it the way I did. Welcome to the club.</p>
<h2>The ++ thing that broke me</h2>
<p>Last topic. Operators — <code>+ - * /</code>, the symbols that do things. Mostly normal. BODMAS came back from school (brackets first, I actually used it):</p>
<pre><code class="language-js">(((6*(3+18))/6)-9)   // 12
</code></pre>
<p>And <code>%</code> gives you the remainder. <code>20 % 3</code> is 2. Twenty rotis, three people, two left over. Nobody cares about % until the day they really, really need it.</p>
<p>But then. Then came <code>++</code>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/d18a4417-4a89-4130-9744-f28ac6bb5aca.png" alt="The ++ trap diagram: sum++ vs ++sum" style="display:block;margin:0 auto" />

<pre><code class="language-js">let sum = 20;
let total = sum++;
</code></pre>
<p>What do you think total is? 21, right? Because sum++ means "add one"?</p>
<p>Nope. total is <strong>20</strong>.</p>
<p>Because <code>sum++</code> takes a photo FIRST and increments LATER. It grabs 20, hands it to total, and THEN sum becomes 21. Like that friend who says "I'll do it later" and means it.</p>
<p>But:</p>
<pre><code class="language-js">let sum = 20;
let total = ++sum;
</code></pre>
<p>NOW total is 21. Because <code>++sum</code> increments FIRST, then hands it over. Same two characters. Different side. Different answer.</p>
<p>I genuinely sat staring at this for ten minutes. Ten. Minutes.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/4630edb1-39e0-43b8-9586-a8a4c0a04da0.gif" alt="Nerd with exploding brain GIF" style="display:block;margin:0 auto" />

<p>Anyway. Once I recovered:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/a8671763-e17d-4986-9217-70fc07902826.webp" alt="Winnie the Pooh i++ vs i += 1 meme" style="display:block;margin:0 auto" />

<p><code>i++</code> <em>and</em> <code>i += 1</code> <em>do the same thing. One of them just wears a tuxedo. (via lesjoiesducode.fr)</em></p>
<hr />
<p>So that's day 3. Arrays, objects, JavaScript lying about types, and the <code>++</code> that gaslit me.</p>
<p>Tomorrow is <code>==</code> vs <code>===</code> and I'm honestly a little scared. See you there.</p>
]]></content:encoded></item><item><title><![CDATA[Day 2: The Six Flavors of Data (or: What's Actually Inside the Box?)]]></title><description><![CDATA[Welcome back! Yesterday we learned to make boxes (variables) and talk to the browser. Today — Day 2 of my JavaScript journey with my web development course — we ask a deeper question:
What's actually ]]></description><link>https://mudassarbhatti.hashnode.dev/day-2-the-six-flavors-of-data-or-what-s-actually-inside-the-box</link><guid isPermaLink="true">https://mudassarbhatti.hashnode.dev/day-2-the-six-flavors-of-data-or-what-s-actually-inside-the-box</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[webdev]]></category><category><![CDATA[#LearninPublic]]></category><dc:creator><![CDATA[Mudassar Ali]]></dc:creator><pubDate>Mon, 05 Oct 2026 12:57:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/970ac382-e71c-4b9a-ba74-15fc1bdfabfe.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome back! Yesterday we learned to make boxes (variables) and talk to the browser. Today — Day 2 of my JavaScript journey with <strong>my web development course</strong> — we ask a deeper question:</p>
<p>What's actually allowed <em>inside</em> those boxes?</p>
<p>In JavaScript, values come in different "species" called <strong>data types</strong>. There are 7 in total. Today we met 6 of them — the family called <strong>primitives</strong>. (Primitive = the simple, basic ones. The complicated family comes tomorrow. Don't worry, you'll love them.)</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/6eff8e31-e1ba-4b05-b947-86443b927b44.png" alt="Six species of primitive data types" /></p>
<p>Think of it like this: you wouldn't put petrol in a water bottle, right? Different contents, different containers. Same idea — different kinds of values, different rules.</p>
<h2>1. Number — the chill one</h2>
<p>In some languages, you have to announce "this is an integer, this is a decimal" like you're filling out a government form. JavaScript doesn't care. One type covers everything:</p>
<pre><code class="language-js">let account_balance = 30;
</code></pre>
<p>10, -30, 10.8, 19.68 — all just "number". Integers, negatives, decimals — JavaScript shrugs and says "number hai, number." No int-vs-float drama. Beautiful.</p>
<h2>2. String — text in quotes</h2>
<pre><code class="language-js">let str = "double quotes";
let comment = 'single quotes';
</code></pre>
<p>Double quotes or single quotes — your choice, both work the same. (Remember yesterday's beads-on-a-string? Same thing.)</p>
<p>Quick question for you: what do you think happens if you forget the quotes and write <code>let name = Ali;</code>? Hold that thought — try it in your console later and watch JavaScript get confused. That's how you learn: break things on purpose.</p>
<h2>3. Boolean — the light switch</h2>
<p>True or false. On or off. Yes or no. That's it — the simplest data type in existence.</p>
<p>And this is where my teacher's sense of humor showed up. My actual practice variable from class:</p>
<pre><code class="language-js">let Papa_ko_block_kara_hai = false;
console.log(typeof Papa_ko_block_kara_hai); // boolean
</code></pre>
<p>Translation for non-Urdu speakers: "Have I blocked Papa?" = false. (No Papa was blocked in the making of this lesson.)</p>
<p>Now that word <strong>typeof</strong> — it's JavaScript's way of asking "what species is this thing?" Like a doctor checking your blood group. <code>typeof false</code> gives you "boolean". Try it yourself: open your console, type <code>typeof 42</code>, <code>typeof "hello"</code>, <code>typeof true</code>. Go on, I'll wait.</p>
<h2>4 &amp; 5. undefined vs null — the twins everyone mixes up</h2>
<p>Okay, deep breath. This is where beginners' brains melt. Two different ways of saying "nothing". Sounds the same? It's not. At all.</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/32b780ab-bd64-4902-a276-9e8352376e66.png" alt="undefined vs null: spot the difference" /></p>
<pre><code class="language-js">let account;        // declared, never assigned → undefined
let bal = null;     // deliberately set to "nothing" → null
</code></pre>
<p>Here's my analogy: <strong>undefined</strong> is the lunchbox you BOUGHT but never put food in. Empty by accident — you just... forgot. <strong>null</strong> is the plate you deliberately served EMPTY. You chose nothing. On purpose. Maybe you're fasting. Maybe it's a diet. The point is: it was a decision.</p>
<p>So: undefined = "I never got around to it." null = "I thought about it and chose nothing."</p>
<p>And now — the most famous bug in JavaScript history:</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/00500121-b0e6-4d7a-99b8-2f1a02b6994d.png" alt="typeof null returns object meme" /></p>
<pre><code class="language-js">console.log(typeof null); // "object"
</code></pre>
<p>Wait, WHAT?! null is not an object. It's nothing! But JavaScript says "object" — because of a bug from 1995, in the very first version, that was never fixed. Why not? Because fixing it would break half the websites on the internet. So JavaScript looked at its own mistake and said "this is fine." Now it's "standard behavior."</p>
<p><img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/50012d1e-6108-4b83-88df-4bd0387068df.jpg" alt="0 vs NULL meme" /></p>
<p><em>This meme explains null better than I ever could. (via pleated-jeans.com)</em></p>
<h2>6. BigInt — for numbers that ate too much</h2>
<p>Normal JavaScript numbers have a speed limit:</p>
<pre><code class="language-js">console.log(Number.MAX_SAFE_INTEGER); // 9007199254740991
</code></pre>
<p>That's 9 quadrillion. Sounds like plenty — until you're counting something enormous and your numbers start glitching past the limit.</p>
<p>Enter <strong>BigInt</strong> — the heavy-duty truck of numbers. How do you make one? Stick an 'n' at the end:</p>
<pre><code class="language-js">let a = 4343147836124791823749832n;
</code></pre>
<p><img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/f0c5200a-e272-418f-8666-46d9370884b1.png" alt="BigInt VIP badge for huge numbers" /></p>
<p>That little 'n' is a VIP badge: "this number is too big for the normal lane." Without it, JavaScript would round it and quietly give you the wrong answer. With it? Perfect precision, no matter how huge.</p>
<h2>Our Day 2 report card</h2>
<p>Six species down:</p>
<ul>
<li><strong>number</strong> — 30, -5, 10.8, all one happy family</li>
<li><strong>string</strong> — text in quotes, your pick of quotes</li>
<li><strong>boolean</strong> — true/false, the light switch</li>
<li><strong>undefined</strong> — empty by accident</li>
<li><strong>null</strong> — empty on purpose (and NOT an object, no matter what typeof claims)</li>
<li><strong>bigint</strong> — huge numbers with the 'n' VIP badge</li>
</ul>
<p>Concepts living in my head rent-free: 14 and counting.</p>
<hr />
<p>Tomorrow: the OTHER family — <strong>non-primitives</strong>. Arrays, objects, functions. That's where JavaScript stops being polite and starts getting real. See you there.</p>
]]></content:encoded></item><item><title><![CDATA[Day 1: I Made a Computer Listen to Me (And You Can Too)]]></title><description><![CDATA[Hey! Come here, sit with me for five minutes.
I'm Mudassar. I study physiotherapy — yes, the body-movement science — and last week I decided to also learn how to build websites. I'm learning web devel]]></description><link>https://mudassarbhatti.hashnode.dev/day-1-i-made-a-computer-listen-to-me-and-you-can-too</link><guid isPermaLink="true">https://mudassarbhatti.hashnode.dev/day-1-i-made-a-computer-listen-to-me-and-you-can-too</guid><dc:creator><![CDATA[Mudassar Ali]]></dc:creator><pubDate>Mon, 05 Oct 2026 12:26:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/3e5861f0-1a41-4f5c-aab3-42c5f722967c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey! Come here, sit with me for five minutes.</p>
<p>I'm Mudassar. I study physiotherapy — yes, the body-movement science — and last week I decided to also learn how to build websites. I'm learning web development these days, and I'm writing down everything I learn in the simplest words I know.</p>
<p>Quick question before we start: have you ever written a line of code? If your answer is "no"... perfect. You're exactly where I was yesterday. We're doing this together.</p>
<h2>Okay, but what IS JavaScript?</h2>
<p>Imagine giving instructions to a very literal-minded friend. "Pick up that cup" — and he picks it up. A programming language is just that: a way of giving instructions to a computer.</p>
<p>Now picture a house. (Stay with me here.)</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/e193fb7f-ebf9-4e77-9abb-a9e52db21106.png" alt="" style="display:block;margin:0 auto" />

<ul>
<li><p><strong>HTML</strong> = the bricks and walls. The structure.</p>
</li>
<li><p><strong>CSS</strong> = the paint and furniture. The looks.</p>
</li>
<li><p><strong>JavaScript</strong> = the electricity and the doors. The stuff that makes things WORK.</p>
</li>
</ul>
<p>See that calculator on a shopping website? Buttons, numbers appearing, total changing — that's JavaScript doing push-ups behind the scenes. Without it, the buttons would just sit there. Pretty, but useless. Like a doorbell with no wiring.</p>
<p>So tell me — does that make sense? HTML = what it is. CSS = how it looks. JavaScript = what it does. Got it? Good. This one idea will carry you through months of learning.</p>
<h2>My first conversation with a computer</h2>
<p>Deep breath. Here's the first line of code I ever typed in my life:</p>
<pre><code class="language-js">console.log("hello world");
</code></pre>
<p>I pressed run. The computer answered: <code>hello world</code>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/ab30648f-fea8-42b3-9172-ec2ea253afaa.png" alt="" style="display:block;margin:0 auto" />

<p>I know, it's just text on a screen. But YOU try talking to a machine for the first time and not feeling like a hacker.</p>
<p>Now — I remember staring at this line thinking "what are these magic words?" So let me translate, like you're five:</p>
<ul>
<li><p><strong>console</strong> — every browser has a secret diary hidden inside it. That's the console.</p>
</li>
<li><p><strong>log</strong> — literally means "write it down."</p>
</li>
<li><p>Together: <em>"Dear diary, please write down: hello world."</em></p>
</li>
</ul>
<p>And those <code>" "</code> marks? They tell JavaScript: "hey, this is TEXT." Programmers call text a <strong>string</strong>. Why? Because it's a string of characters — like beads on a string. Now you know your first programmer word. Use it at dinner parties.</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/2119c7e6-5369-492a-b172-d02b851be680.jpg" alt="" style="display:block;margin:0 auto" />

<p><em>This is literally what happens. One line of code, and suddenly you're spamming "hello world" to everyone you know. (Comic via ProgrammerHumor.io)</em></p>
<p><strong>WAIT — YOUR TURN.</strong> Don't just read this. Open your browser right now, press <code>Ctrl+Shift+J</code> (a little panel pops up — that's the diary!), type <code>console.log("I am learning JavaScript")</code> and press Enter.</p>
<p>Did your message appear? Then congratulations — you just wrote JavaScript. We're programmers now. Both of us.</p>
<h2>Boxes with names (or: where do I keep stuff?)</h2>
<p>Where do you keep your money so you don't lose it? A wallet, right? In, out, whenever you need it.</p>
<p>Code works the same way. A <strong>variable</strong> is just a named box where you keep a value for later. ("Variable" = something that can <em>vary</em>, change. See? Even the jargon makes sense when someone bothers to explain it.)</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/90a962ea-20c0-4a6e-9aa6-a500fc85c6be.png" alt="" style="display:block;margin:0 auto" />

<pre><code class="language-js">let num = 10.5;
console.log(num);
</code></pre>
<p>Read it out loud with me, like a sentence: <em>"Make a new box. Name it num. Put 10.5 inside."</em></p>
<ul>
<li><p><strong>let</strong> = "I'm making a new box."</p>
</li>
<li><p><strong>num</strong> = the name on the label.</p>
</li>
<li><p><strong>=</strong> = "put this inside." NOT "equals" like in maths! This confuses every beginner, so let's kill it right now: in code, <code>=</code> means <em>assign</em>.</p>
</li>
<li><p><strong>10.5</strong> = what's inside.</p>
</li>
</ul>
<p>Then <code>console.log(num)</code> peeks inside and shows <code>10.5</code>. Simple, right?</p>
<h2>Three kinds of boxes (the fun part)</h2>
<p>JavaScript gives you three kinds of boxes — and my teacher gave us the perfect way to remember them:</p>
<img src="https://cdn.hashnode.com/uploads/covers/654354f81ddeaaaafa662eb2/ac7390be-0e65-461a-9a03-2f05402c3f2a.png" alt="" style="display:block;margin:0 auto" />

<p><strong>1.</strong> <code>let</code> <strong>— the whiteboard</strong></p>
<pre><code class="language-js">let ar = "Ali";
ar = "mohit";
console.log(ar);  // shows "mohit"
</code></pre>
<p>Write "Ali" on a whiteboard. Changed your mind? Erase it, write "mohit". The latest value wins — that's why the output is <code>mohit</code>. Use <code>let</code> for things that update, like a game score or items in a shopping cart.</p>
<p><strong>2.</strong> <code>const</code> <strong>— carved in stone</strong></p>
<pre><code class="language-js">const ids = 20;
console.log(ids);
// ids = 30;   ← try this and JavaScript YELLS at you
</code></pre>
<p><strong>const</strong> = constant = locked forever. When would you want that? Your CNIC number. Your date of birth. Things that should NEVER change while the program runs. Lock them with <code>const</code> and sleep peacefully.</p>
<p><strong>3.</strong> <code>var</code> <strong>— the old Nokia</strong></p>
<pre><code class="language-js">var x = 10;
x = 20;
console.log(x);
</code></pre>
<p>Before <code>let</code> and <code>const</code>, everyone used <code>var</code>. Sir's exact words — I'm quoting — <em>"var old tarike, don't use it."</em> It still works, like an old Nokia still makes calls. But would you buy one in 2026? Exactly. You'll trip over <code>var</code> in old YouTube tutorials — now instead of panicking, you'll go "ah, the old way." You're welcome.</p>
<h2>Our Day 1 report card</h2>
<p>Let's see what WE learned (you did the try-it-yourself part, right? RIGHT?):</p>
<ul>
<li><p>You can talk to the browser (<code>console.log</code> — our new best friend)</p>
</li>
<li><p>You can store things in named boxes (<code>let</code>)</p>
</li>
<li><p>You know which boxes lock forever (<code>const</code>)</p>
</li>
<li><p>You know the old box to avoid (<code>var</code>)</p>
</li>
</ul>
<p>Lines of code I'd written before today: <strong>0</strong>. Today: <strong>8</strong>. Growth: <strong>infinite</strong>.</p>
<hr />
<p>So — how did it feel? Be honest. Not as scary as you expected, right?</p>
<p>Tomorrow we meet the <strong>data types</strong> — the different species of values: numbers, text, yes/no answers... and a couple of weird ones that'll make you laugh.</p>
<p>Stick around. We're just getting started.</p>
]]></content:encoded></item></channel></rss>