<?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>Forem: wael.hajji</title>
    <description>The latest articles on Forem by wael.hajji (@waeeelhajji).</description>
    <link>https://forem.com/waeeelhajji</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%2F698131%2F1bf2e9ac-611a-42e0-8c3a-5c525de7e4d8.jpg</url>
      <title>Forem: wael.hajji</title>
      <link>https://forem.com/waeeelhajji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/waeeelhajji"/>
    <language>en</language>
    <item>
      <title>JavaScript Fundamentals 🍝</title>
      <dc:creator>wael.hajji</dc:creator>
      <pubDate>Tue, 19 Aug 2025 01:59:39 +0000</pubDate>
      <link>https://forem.com/waeeelhajji/javascript-fundamentals-5cnc</link>
      <guid>https://forem.com/waeeelhajji/javascript-fundamentals-5cnc</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Chapter 1: Variable Declaration &amp;amp; Scoped Memory Patterns&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;“If you don’t understand variables, you don’t understand programming.” – Every developer ever.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Welcome, fellow coder! 👋&lt;br&gt;
This is not just another corner of the internet where I paste code and call it a day. Nope. 🚫&lt;br&gt;
Here, I’ll walk you through the story behind concepts, the “aha!” moments, the things I wish someone explained better when I started.&lt;/p&gt;

&lt;p&gt;So buckle up — we’re kicking things off with &lt;strong&gt;variables in JavaScript.&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;🌱 What’s the Big Deal with Variables?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine your brain as a giant office full of drawers.&lt;br&gt;
Each drawer has a label (the variable name) and stuff inside it (the value).&lt;/p&gt;

&lt;p&gt;JavaScript gives us three types of drawers to work with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;var&lt;/strong&gt; → The messy old drawer everyone used before. Always open, stuff falls out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;let&lt;/strong&gt; → A neat drawer you can open only in the right room (block scope).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;const&lt;/strong&gt; → A locked drawer. Once you label it, the label never changes — but the contents might still shuffle.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;strong&gt;🧠 Scope = Where Your Drawers Exist&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scope is like the room your drawer lives in.&lt;/p&gt;

&lt;p&gt;Global scope: Everyone in the building sees it.&lt;/p&gt;

&lt;p&gt;Function scope (&lt;code&gt;var&lt;/code&gt;): Only people inside this office can see it.&lt;/p&gt;

&lt;p&gt;Block scope (&lt;code&gt;let&lt;/code&gt;/&lt;code&gt;const&lt;/code&gt;): Only people in this little corner see it.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
  var oldDrawer = "I escape!";
  let neatDrawer = "I stay here!";
  const lockedDrawer = "I’m also here!";
}

console.log(oldDrawer);  // ✅ Works
console.log(neatDrawer); // ❌ Error
console.log(lockedDrawer); // ❌ Error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the difference? var leaks, while let/const stay local.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;⚡ Hoisting – JavaScript’s Magic Trick&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript doesn’t actually run top-to-bottom like you’d think.&lt;br&gt;
It secretly lifts (hoists) declarations to the top before executing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(x); // undefined, but no error
var x = 5;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But with &lt;strong&gt;let/const&lt;/strong&gt;, you get the mysterious Temporal Dead Zone (TDZ):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(y); // ❌ ReferenceError
let y = 10;`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think of it as JavaScript saying:&lt;br&gt;
“Hey, I know about &lt;code&gt;y&lt;/code&gt;… but you can’t touch it yet.”&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;💡 Why const Is More Popular Than You Think&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A lot of devs use const even for objects and arrays.&lt;br&gt;
Why? Because in JavaScript, const doesn’t mean immutable. It just means you can’t reassign the variable name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const car = { brand: "Tesla" };
car.brand = "BMW"; // ✅ Works
car = { brand: "Audi" }; // ❌ Error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This teaches us a crucial point:&lt;br&gt;
👉 Variables store &lt;strong&gt;references&lt;/strong&gt;, not the actual data.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🛠 Real-World Analogy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; as renting an apartment in a gated community.&lt;br&gt;
You control who has the keys (scope), but once the contract (const) is signed, you can’t just move to another apartment. You can, however, redecorate the inside.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🚀 Learning Goals Recap&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By now, you should:&lt;br&gt;
✔️ Know the difference between &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, and &lt;code&gt;const&lt;/code&gt;&lt;br&gt;
✔️ Understand scope &amp;amp; the TDZ&lt;br&gt;
✔️ Predict hoisting behavior&lt;br&gt;
✔️ Appreciate why &lt;code&gt;const&lt;/code&gt; is safer for predictable code&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🗣 Discussion Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why might a developer opt for &lt;code&gt;const&lt;/code&gt; even when dealing with non-constant objects?&lt;br&gt;
What does that reveal about how JavaScript handles references? 🤔&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🎯 Final Words&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables aren’t just a “first chapter” thing.&lt;br&gt;
They’re the foundation you’ll lean on all the way to &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Node&lt;/strong&gt;, and** MERN**.&lt;br&gt;
Master this, and you’ve just sharpened one of the most important tools in your developer toolbox. 🔑&lt;/p&gt;

&lt;p&gt;Let’s build. Let’s laugh. Let’s level up.&lt;br&gt;
Welcome to my journey — and maybe yours too. 🌍👨‍💻&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>learning</category>
    </item>
    <item>
      <title>I’m Not Just Sharing Code — I’m Sharing the Story Behind It</title>
      <dc:creator>wael.hajji</dc:creator>
      <pubDate>Thu, 17 Jul 2025 10:44:28 +0000</pubDate>
      <link>https://forem.com/waeeelhajji/im-not-just-sharing-code-im-sharing-the-story-behind-it-2573</link>
      <guid>https://forem.com/waeeelhajji/im-not-just-sharing-code-im-sharing-the-story-behind-it-2573</guid>
      <description>&lt;p&gt;Hey devs! 👋&lt;/p&gt;

&lt;p&gt;I’m Wael Hajji, a full-stack instructor and startup mentor passionate about helping developers grow and truly understand web development—not just memorize code snippets.&lt;/p&gt;

&lt;p&gt;In this space, I’ll share my journey, practical tips, and simple, hands-on code examples to make learning fun and effective. No boring lectures here—just real stories and clear explanations designed to click with you.&lt;/p&gt;

&lt;p&gt;Why stories? Because every line of code has a “why” behind it, and when you grasp that, coding becomes more than just syntax — it becomes a craft.&lt;/p&gt;

&lt;p&gt;Expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy-to-follow tutorials&lt;/li&gt;
&lt;li&gt;Thoughtful explanations&lt;/li&gt;
&lt;li&gt;Real-world scenarios&lt;/li&gt;
&lt;li&gt;A sprinkle of humor and personal experience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you’re starting out or leveling up your skills, my goal is to make you confident and excited to code.&lt;/p&gt;

&lt;p&gt;Let’s build a community where learning feels like a journey, not a chore.&lt;/p&gt;

&lt;p&gt;Stay tuned for upcoming posts — I promise you’ll enjoy them as much as I enjoy creating them!&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀💻&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
