<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shamima Alina on Medium]]></title>
        <description><![CDATA[Stories by Shamima Alina on Medium]]></description>
        <link>https://medium.com/@shamimaAlina?source=rss-1d1a686cf49d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i_rk-qguZFrOpMM54Hc7Hw.jpeg</url>
            <title>Stories by Shamima Alina on Medium</title>
            <link>https://medium.com/@shamimaAlina?source=rss-1d1a686cf49d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:07:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shamimaAlina/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Tech Tip Tuesday: 5 Ways to Speed Up Your Next.js App]]></title>
            <link>https://medium.com/@shamimaAlina/tech-tip-tuesday-5-ways-to-speed-up-your-next-js-app-7d58a125adef?source=rss-1d1a686cf49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d58a125adef</guid>
            <category><![CDATA[tech-tip-tricks]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[Shamima Alina]]></dc:creator>
            <pubDate>Tue, 25 Mar 2025 19:27:56 GMT</pubDate>
            <atom:updated>2025-03-26T07:33:05.672Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*CFZ2A99lviIgqg2HSp9Kgg.jpeg" /></figure><p>Next.js is awesome, but your app can feel sluggish if you don’t optimize it. Here are <strong>5 quick tips</strong> to make it run faster:</p><p>1️⃣ <strong>Use Dynamic Imports &amp; Lazy Loading</strong></p><ul><li>Reduce initial load time by dynamically importing components:</li></ul><pre>import dynamic from &quot;next/dynamic&quot;;<br>const HeavyComponent = dynamic(() =&gt; import(&quot;../components/HeavyComponent&quot;), { ssr: false });</pre><p>2️⃣ <strong>Optimize Images with Next.js Image Component</strong></p><ul><li>Instead of using &lt;img&gt;, leverage Next.js&#39;s built-in &lt;Image&gt; component for better compression &amp; lazy loading:</li></ul><pre>import Image from &quot;next/image&quot;;  <br>&lt;Image src=&quot;/hero.jpg&quot; width={500} height={300} alt=&quot;Hero image&quot; /&gt;</pre><p>3️⃣ <strong>Enable Automatic Static Optimization</strong></p><ul><li>Use <strong>getStaticProps()</strong> or <strong>getStaticPaths()</strong> to pre-render pages at build time for better performance.</li></ul><p>4️⃣ <strong>Reduce Bundle Size with Code Splitting</strong></p><ul><li>Analyze your bundle size with next build + next analyze to remove unused dependencies.</li></ul><p>5️⃣ <strong>Leverage Edge Functions &amp; Middleware</strong></p><ul><li>Move logic closer to users with Edge Functions to improve speed and scalability.</li></ul><p>💡 <strong>What’s your favorite Next.js optimization tip? Let’s discuss in the comments!</strong> 👇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d58a125adef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering JavaScript Conditionals: A Beginner’s Guide to If, Else, and Switch]]></title>
            <link>https://medium.com/@shamimaAlina/mastering-javascript-conditionals-a-beginners-guide-to-if-else-and-switch-00cf7b058087?source=rss-1d1a686cf49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/00cf7b058087</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[basic-javascritp]]></category>
            <category><![CDATA[javascript-concepts]]></category>
            <category><![CDATA[beginner-javascript]]></category>
            <dc:creator><![CDATA[Shamima Alina]]></dc:creator>
            <pubDate>Sat, 25 Jan 2025 15:02:37 GMT</pubDate>
            <atom:updated>2025-01-25T15:02:37.529Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eq--vS8n_tgfu78y-eiqkA.jpeg" /></figure><p>Imagine you’re playing a game, and depending on what you do, the game reacts differently. For example, if you choose the blue door, you go into a magical garden. If you choose the red door, you meet a dragon. Programming works the same way — it lets us make decisions and take different actions based on different conditions. In JavaScript, we do this using <strong>if</strong>, <strong>else</strong>, and <strong>switch</strong> statements.</p><p>Let’s break it down step by step so it’s super easy to understand.</p><h3>What Are Conditional Statements?</h3><p>Conditional statements are like the rules of a game. They let you tell your program:</p><blockquote><em>“Hey, if something is true, do this. Otherwise, do something else.”</em></blockquote><p>These rules make your program smart and able to respond to different situations.</p><h3>1. If-Else: Making Simple Decisions</h3><p>Think of <strong>if-else</strong> as a question you ask. For example:</p><ul><li><strong>If</strong> it’s sunny, wear sunglasses.</li><li><strong>Else</strong> (otherwise), carry an umbrella.</li></ul><p>Here’s how it looks in JavaScript:</p><pre>let weather = &quot;sunny&quot;;<br><br>if (weather === &quot;sunny&quot;) {<br>  console.log(&quot;Wear sunglasses!&quot;);<br>} else {<br>  console.log(&quot;Carry an umbrella!&quot;);<br>}</pre><p><strong>How it works:</strong></p><ul><li>The program checks if the weather is &quot;sunny.&quot;</li><li>If it is, it prints “Wear sunglasses!”</li><li>If it’s not, it prints “Carry an umbrella!”</li></ul><h3>2. Adding More Conditions with Else If</h3><p>Sometimes, you have more than two choices. For example:</p><ul><li><strong>If</strong> it’s sunny, wear sunglasses.</li><li><strong>Else if</strong> it’s raining, carry an umbrella.</li><li><strong>Else</strong> just enjoy your day.</li></ul><p>Here’s how you’d write that:</p><pre>let weather = &quot;raining&quot;;<br><br>if (weather === &quot;sunny&quot;) {<br>  console.log(&quot;Wear sunglasses!&quot;);<br>} else if (weather === &quot;raining&quot;) {<br>  console.log(&quot;Carry an umbrella!&quot;);<br>} else {<br>  console.log(&quot;Just enjoy your day!&quot;);<br>}</pre><p><strong>How it works:</strong></p><ul><li>The program checks the first condition (sunny).</li><li>If it’s not sunny, it checks the second condition (raining).</li><li>If none of the conditions are true, it runs the last block.</li></ul><h3>3. Switch: When You Have Many Options</h3><p>Now let’s imagine a video game. Depending on what button you press, the character does something:</p><ul><li>Press “A” to jump.</li><li>Press “B” to punch.</li><li>Press “C” to kick.</li><li>Any other button: “Invalid move!”</li></ul><p>In JavaScript, you can handle this with a <strong>switch</strong> statement:</p><pre>let button = &quot;A&quot;;<br><br>switch (button) {<br>  case &quot;A&quot;:<br>    console.log(&quot;Jump!&quot;);<br>    break;<br>  case &quot;B&quot;:<br>    console.log(&quot;Punch!&quot;);<br>    break;<br>  case &quot;C&quot;:<br>    console.log(&quot;Kick!&quot;);<br>    break;<br>  default:<br>    console.log(&quot;Invalid move!&quot;);<br>}</pre><p><strong>How it works:</strong></p><ul><li>The program checks the value of a button.</li><li>Each case is like a possible choice (A, B, or C).</li><li>The default is what happens if no cases match.</li><li>The break stops the program from checking more cases once it finds a match.</li></ul><h3>4. When to Use If-Else or Switch</h3><p>You might wonder, “When should I use <strong>if-else</strong> and when should I use <strong>switch</strong>?”</p><ul><li>Use <strong>if-else</strong> when you’re checking conditions that are more complex, like “if it’s sunny AND warm.”</li><li>Use <strong>switch</strong> when you’re checking for specific values, like “button is A, B, or C.”</li></ul><h3>Fun Example: Choosing a Snack</h3><p>Here’s a fun example. Imagine you’re deciding what snack to eat:</p><pre>let snack = &quot;apple&quot;;<br><br>if (snack === &quot;apple&quot;) {<br>  console.log(&quot;Healthy choice!&quot;);<br>} else if (snack === &quot;chocolate&quot;) {<br>  console.log(&quot;A sweet treat!&quot;);<br>} else {<br>  console.log(&quot;Try something new!&quot;);<br>}<br><br>// Same thing using switch<br>switch (snack) {<br>  case &quot;apple&quot;:<br>    console.log(&quot;Healthy choice!&quot;);<br>    break;<br>  case &quot;chocolate&quot;:<br>    console.log(&quot;A sweet treat!&quot;);<br>    break;<br>  default:<br>    console.log(&quot;Try something new!&quot;);<br>}</pre><p>Both give you the same result, but sometimes one approach might be easier to read.</p><h3>Key Tips to Remember</h3><ol><li><strong>Conditions are questions.</strong> The program checks if the condition is true or false.</li><li><strong>Indentation helps readability.</strong> Always use proper spacing so your code is easy to follow.</li><li><strong>Default in switch is like else in if-else.</strong> It handles all the cases that don’t match.</li></ol><h3>Practice Time!</h3><p>Try writing your programs:</p><ol><li>Write a program that checks if a number is positive, negative, or zero.</li><li>Create a program that gives different messages for different fruits (apple, banana, orange).</li><li>Write a switch program for a TV remote where each button changes the channel or volume.</li></ol><p>The more you practice, the better you’ll get! Soon, you’ll be writing smart, interactive programs in no time.</p><h4>Coding is fun😊</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00cf7b058087" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Best Practices: var vs let vs const Explained]]></title>
            <link>https://medium.com/@shamimaAlina/javascript-best-practices-var-vs-let-vs-const-explained-aabe0298bf7c?source=rss-1d1a686cf49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aabe0298bf7c</guid>
            <category><![CDATA[variables-in-javascript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Shamima Alina]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 13:14:54 GMT</pubDate>
            <atom:updated>2025-01-12T13:14:54.399Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6ppgry-vmM_O3y67cdEtQ.jpeg" /></figure><p>Imagine you have three kinds of magical boxes to store your treasures (like toys, candies, or crayons). These boxes are called <strong>var</strong>, <strong>let</strong>, and <strong>const</strong> in JavaScript. In this guide, we’ll explore <strong>JavaScript variable scopes</strong> and share <strong>best practices</strong> for deciding which one to use.</p><h3>What Are Variables in JavaScript?</h3><p>Variables are like <strong>boxes</strong> where we can keep things safe. Each box has a <strong>label</strong> (name), so we can easily find what’s inside.<br> For example:</p><pre>let toy = &quot;Car&quot;; // A box named &quot;toy&quot; holding &quot;Car&quot;<br>console.log(toy); // Car</pre><h3><strong>Understanding JavaScript Variable Scopes</strong>: var, let, and const Explained</h3><h4>1. var: The Old, Confusing Box</h4><p>var is like an old toy box that doesn’t follow many rules. You can scribble over the label, move it around the house, or even lose track of it. It works, but it can be messy.</p><p><strong>Example:</strong></p><pre>var candy = &quot;Chocolate&quot;;<br>console.log(candy); // Chocolate<br><br>var candy = &quot;Lollipop&quot;; // You scribble out the old label and write a new one<br>console.log(candy); // Lollipop</pre><p>This is okay, but if you have too many scribbles, things might get confusing. So, we don’t use var much anymore.</p><h4>2. let: The New and Polite Box</h4><p>let is a <strong>modern, well-behaved box</strong>. It follows the rules:</p><ul><li>You <strong>can’t reuse the label</strong>.</li><li>The box stays only in the room (block) where you made it.</li></ul><p><strong>Example:</strong></p><pre>let toy = &quot;Car&quot;;<br>console.log(toy); // Car<br><br>// let toy = &quot;Doll&quot;; // ❌ Nope! You can&#39;t reuse the &quot;toy&quot; label in the same place.<br>toy = &quot;Doll&quot;; // But you can change what&#39;s inside.<br>console.log(toy); // Doll</pre><p>Think of let as a neat box that stays organized in one spot and only allows changes inside the same box.</p><h4>3. const: The Super-Strong Box</h4><p>const is the <strong>strongest box</strong>. Once you put something inside, you <strong>can’t change it</strong>. The label and the contents stay the same forever.</p><p><strong>Example:</strong></p><pre>const crayons = &quot;Red Crayon&quot;;<br>console.log(crayons); // Red Crayon<br><br>// crayons = &quot;Blue Crayon&quot;; // ❌ Nope! This box is locked.</pre><p>It’s like a treasure chest with a lock — you put a red crayon inside and throw away the key.</p><h3>Advanced Use Cases</h3><h4>1. Variable Scoping</h4><ul><li>var has <strong>function scope</strong>, meaning it can be accessed anywhere inside the function it’s defined in. This can lead to bugs if used improperly.</li><li>let and const have <strong>block scope</strong>, so they’re only accessible within the {} block where they’re declared.</li></ul><p><strong>Example:</strong></p><pre>function scopeExample() {<br>    if (true) {<br>        var oldBox = &quot;I’m `var`&quot;;<br>        let modernBox = &quot;I’m `let`&quot;;<br>    }<br>    console.log(oldBox); // Accessible<br>    // console.log(modernBox); // ❌ Error: modernBox is not defined<br>}</pre><h4>2. const with Objects and Arrays</h4><p>While const prevents reassignment, you can still modify properties of objects or arrays stored in a const variable.</p><p><strong>Example:</strong></p><pre>const treasure = { gold: 100 };<br>treasure.gold = 200; // Allowed!<br>console.log(treasure.gold); // 200<br><br>// treasure = { gold: 300 }; // ❌ Error: Assignment to constant variable</pre><h3>When Should You Use Them?</h3><ol><li><strong>Use </strong><strong>const:</strong><br> If you’re 100% sure you won’t change what’s in the box. For example:</li></ol><pre>const myName = &quot;Tommy&quot;; <br>console.log(myName); // Tommy</pre><ol><li><strong>Use </strong><strong>let:</strong><br> If you might want to change what’s in the box later. For example:</li></ol><pre>let favoriteCandy = &quot;Chocolate&quot;; <br>favoriteCandy = &quot;Gummy Bear&quot;; // Yum! You can change it.<br> console.log(favoriteCandy); // Gummy Bear</pre><ol><li><strong>Avoid </strong><strong>var:</strong><br> It’s like using an old, creaky box. Use let or const instead—they’re better.</li></ol><h3>Common Pitfalls to Avoid</h3><ol><li><strong>Using </strong><strong>var in Loops:</strong></li></ol><pre>for (var i = 0; i &lt; 3; i++) {<br>setTimeout(() =&gt; console.log(i), 1000); // Prints 3, 3, 3<br> }</pre><ol><li>Use let instead to avoid scope issues:</li></ol><pre>for (let i = 0; i &lt; 3; i++) {<br>setTimeout(() =&gt; console.log(i), 1000); // Prints 0, 1, 2 <br>}</pre><ol><li><strong>Reassigning </strong><strong>const:</strong></li></ol><pre>const name = &quot;Alice&quot;;<br> // name = &quot;Bob&quot;;<br> // ❌ Error: Assignment to constant variable</pre><h3>Why This Matters</h3><p>Using the right variable (let or const) keeps your code clean, organized, and bug-free. In modern JavaScript development:</p><ul><li>Default to <strong>const</strong> unless you know you need to reassign.</li><li>Use <strong>let</strong> when you expect the value to change.</li><li>Avoid <strong>var</strong> entirely to prevent unpredictable behavior.</li></ul><p>Want to master <strong>JavaScript best practices</strong>? Try experimenting with <strong>JavaScript variable scopes</strong> on <a href="https://codepen.io/">CodePen</a> or <a href="https://jsfiddle.net/">JSFiddle</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aabe0298bf7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Operators, Made Simple and Fun]]></title>
            <link>https://medium.com/@shamimaAlina/javascript-operators-made-simple-and-fun-bf6106ec7ee0?source=rss-1d1a686cf49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf6106ec7ee0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Shamima Alina]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 16:00:02 GMT</pubDate>
            <atom:updated>2025-01-06T16:00:02.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UiilUg3GOcrhe_YJA_0kyQ.jpeg" /></figure><h3>1. Arithmetic Operators</h3><p>These are for <strong>doing math</strong></p><ul><li><strong>+ (Addition):</strong> Like putting candies together.</li></ul><pre>let candies = 2 + 3; // You have 2 candies, then you get 3 more, now you have 5 candies! console.log(candies); // 5</pre><ul><li><strong>- (Subtraction):</strong> Like taking away candies.</li></ul><pre>let candies = 5 - 2; // You have 5 candies, you give away 2, so you have 3 left. console.log(candies); // 3</pre><ul><li><strong>* (Multiplication):</strong> Like having many boxes of candies.</li></ul><pre>let boxes = 3 * 2; // You have 3 boxes and each box has 2 candies, so you have 6 candies. console.log(boxes); // 6</pre><ul><li><strong>/ (Division):</strong> Like sharing candies equally.</li></ul><pre>let candies = 6 / 2; // You have 6 candies, and you share them with 2 friends. Each gets 3. console.log(candies); // 3</pre><ul><li><strong>% (Remainder):</strong> Like counting how many candies are left after sharing.</li></ul><pre>let leftover = 7 % 3; // You have 7 candies, and you share them with 3 friends. 1 candy is left. console.log(leftover); // 1</pre><ul><li><strong>++ (Increase by 1):</strong> Like getting one more candy!</li></ul><pre>let candies = 3; candies++; // You got 1 more candy, now you have 4. console.log(candies); // 4</pre><ul><li><strong>-- (Decrease by 1):</strong> Like eating one candy!</li></ul><pre>let candies = 4; candies--; // You ate 1 candy, now you have 3. console.log(candies); // 3<br></pre><h3>2. Comparison Operators</h3><p>These check if things are <strong>equal</strong> or if one thing is <strong>bigger</strong> than the other.</p><ul><li><strong>== (Equal to):</strong> Is 2 the same as 2?</li></ul><pre>let isSame = 2 == 2; // Yes, they are the same! console.log(isSame); // true</pre><ul><li><strong>!= (Not equal to):</strong> Is 2 not the same as 3?</li></ul><pre>let isDifferent = 2 != 3; // Yes, 2 is different from 3! console.log(isDifferent); // true</pre><ul><li><strong>&gt; (Greater than):</strong> Is 5 bigger than 3?</li></ul><pre>let isBigger = 5 &gt; 3; // Yes, 5 is bigger than 3! console.log(isBigger); // true</pre><ul><li><strong>&lt; (Less than):</strong> Is 2 smaller than 3?</li></ul><pre>let isSmaller = 2 &lt; 3; // Yes, 2 is smaller than 3! console.log(isSmaller); // true</pre><h3>3. Logical Operators</h3><p>These check if something is <strong>true</strong> or <strong>false</strong>.</p><ul><li><strong>&amp;&amp; (AND):</strong> Both things need to be true for the result to be true.</li></ul><pre>let canPlay = true &amp;&amp; true; // You can play if both things are true! console.log(canPlay); // true</pre><ul><li><strong>|| (OR):</strong> At least one thing needs to be true for the result to be true.</li></ul><pre>let canPlay = true || false; // You can play if at least one thing is true! console.log(canPlay); // true</pre><ul><li><strong>! (NOT):</strong> This makes true become false, and false become true.</li></ul><pre>let isHappy = !true; // If you&#39;re not happy, you&#39;re sad. console.log(isHappy); // false</pre><h3>4. Assignment Operators</h3><p>These give values to things.</p><ul><li><strong>= (Assign):</strong> This gives something to a variable.</li></ul><pre>let toys = 3; // You have 3 toys. console.log(toys); // 3</pre><ul><li><strong>+= (Add and assign):</strong> Adds something to what you already have.</li></ul><pre>let toys = 3; toys += 2; // You get 2 more toys, now you have 5. console.log(toys); // 5</pre><ul><li><strong>-= (Subtract and assign):</strong> Takes away from what you have.</li></ul><pre>let toys = 5; toys -= 2; // You give away 2 toys, now you have 3. console.log(toys); // 3</pre><ul><li><strong>*= (Multiply and assign):</strong> Multiplies what you have.</li></ul><pre>let toys = 3; toys *= 2; // You have 3 toys, but now you have 6 because you multiply! console.log(toys); // 6</pre><h3>5. Ternary Operator</h3><p>This is a shortcut for <strong>yes or no</strong> questions.</p><ul><li><strong>? : (Ternary):</strong> You can do something if true, and something else if false.</li></ul><pre>let result = (5 &gt; 3) ? &quot;Yes&quot; : &quot;No&quot;; // Is 5 bigger than 3? Yes, so it&#39;s &quot;Yes&quot;. console.log(result); // &quot;Yes&quot;</pre><h3>6. Type Operators</h3><p>These check what <strong>type</strong> something is.</p><ul><li><strong>typeof:</strong> Tells you what kind of thing it is.</li></ul><pre>let toys = 3; console.log(typeof toys); // &quot;number&quot; (because 3 is a number!)</pre><ul><li><strong>instanceof:</strong> Checks if something is of a special type.</li></ul><pre>let toys = [1, 2, 3]; console.log(toys instanceof Array); // true (because toys is an array!)</pre><h3>7. Spread Operator</h3><p>The spread operator is like <strong>copying</strong> stuff to a new place.</p><ul><li><strong>... (Spread):</strong> It copies things.</li></ul><pre>let toys = [1, 2, 3]; let newToys = [...toys, 4]; // You made a new list with the old toys and 1 more toy! console.log(newToys); // [1, 2, 3, 4]</pre><h3>8. Comma Operator</h3><p>This lets you do <strong>multiple things</strong> in one line.</p><ul><li><strong>, (Comma):</strong> It helps to do many things.</li></ul><pre>let toys = 3, candies = 5; // You have 3 toys and 5 candies. console.log(toys, candies); // 3, 5</pre><h3>Summary:</h3><ul><li><strong>Arithmetic Operators:</strong> +, -, *, /, %, ++, -- (Math!)</li><li><strong>Comparison Operators:</strong> ==, !=, &gt;, &lt;, &gt;=, &lt;= (Are they the same? Is one bigger?)</li><li><strong>Logical Operators:</strong> &amp;&amp;, ||, ! (True/False)</li><li><strong>Assignment Operators:</strong> =, +=, -=, *=, /=, %= (Give things values)</li><li><strong>Ternary:</strong> ? : (Shortcuts for yes/no questions)</li><li><strong>Type Operators:</strong> typeof, instanceof (What is it?)</li><li><strong>Spread:</strong> ... (Copy things)</li><li><strong>Comma:</strong> , (Do multiple things)</li></ul><p>Now, that should be super easy for you to understand 😄 Let me know if you need more examples or explanations!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf6106ec7ee0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Basics: Understanding Variables, Data Types, and Operators]]></title>
            <link>https://medium.com/@shamimaAlina/javascript-basics-understanding-variables-data-types-and-operators-29d423950bbe?source=rss-1d1a686cf49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/29d423950bbe</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript-basic-concept]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shamima Alina]]></dc:creator>
            <pubDate>Sun, 05 Jan 2025 07:34:21 GMT</pubDate>
            <atom:updated>2025-01-06T14:30:40.491Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vP0Hl8KyKS1UUY4LfLcm6w.jpeg" /></figure><h3>1. What Are Variables?</h3><p>Imagine you have a treasure chest 🧰. You can store anything in it — like toys, candies, or books. In JavaScript, a <strong>variable</strong> is like that treasure chest. It holds things for us to use later.</p><p>Here’s how we make a chest (or variable) in JavaScript:</p><pre>let treasure = &quot;gold coins&quot;;  <br>console.log(treasure); // This shows &quot;gold coins&quot;</pre><h4>A Few Types of Treasure Chests:</h4><ul><li><strong>let</strong>: A chest where you can change what’s inside.</li><li><strong>const</strong>: A chest that can’t be changed once it’s filled.</li></ul><p>Example:</p><pre>let toy = &quot;car&quot;;  <br>toy = &quot;robot&quot;; // You can change it.  <br><br>const favoriteSnack = &quot;chocolate&quot;;  <br>// favoriteSnack = &quot;chips&quot;; // This will give an error!</pre><h3>2. Data Types: What Can We Store?</h3><p>Our treasure chest can hold different types of treasures! 🪙✨</p><h4>Types of Data in JavaScript:</h4><ol><li><strong>Strings</strong>: Words or sentences.<br>Example:</li></ol><pre>let greeting = &quot;Hello, world!&quot;;</pre><p><strong>2. Numbers</strong>: Any number (like your age).<br>Example:</p><pre>let age = 5;</pre><p><strong>3. Booleans</strong>: True or false (like yes or no).<br>Example:</p><pre>let isHappy = true;</pre><p><strong>4. Null</strong>: Empty treasure chest.<br>Example:</p><pre>let nothing = null; // there is nothing right now, but maybe later.<br>let cookie = null; // There’s no cookie right now, but maybe later.</pre><p><strong>5. Undefined</strong>: The treasure chest hasn’t been filled yet.<br>Example:</p><pre>let mystery;  // You have a mystery box, but you don&#39;t know what is in it.<br>console.log(mystery); // This shows &quot;undefined&quot;<br>let toy; // You have a toy, but you don’t know what it is yet.<br>console.log(toy); // It shows &quot;undefined&quot; because you didn&#39;t say what toy it is yet.</pre><p><strong>6. Symbol</strong>: Symbols are like secret codes that only one thing can have.</p><ul><li>Example:</li></ul><pre>let secretCode = Symbol(&quot;code&quot;); // It&#39;s a special secret code!</pre><p><strong>7. BigInt: </strong>BigInt is for very, <strong>very</strong> big numbers. Numbers that are so big, they don’t fit into normal ones.</p><ul><li>Example:</li></ul><pre>let bigNumber = 1234567890123456789012345678901234567890n; // A really big number with &#39;n&#39; at the end.</pre><h3>3. Operators: Tools to Work with Treasures</h3><p>Operators are like magic tools 🪄. They help us play with the treasures in our chests.</p><h4>Types of Operators:</h4><ol><li><strong>Arithmetic Operators</strong>: Do math.</li></ol><ul><li>+ (Add</li></ul><pre>let total = 2 + 3; // 5</pre><ul><li>- (Subtract), * (Multiply), / (Divide).</li></ul><pre>let total = 5 - 3; // 2<br>let total = 5 * 3; //15<br>let total = 6 / 3; //2</pre><p><strong>2. Comparison Operators</strong>: Compare things.</p><ul><li>=== (Are they the same?):</li></ul><pre>console.log(5 === 5); // true<br>console.log(5 === 3); // false</pre><ul><li>&gt; (Greater than), &lt; (Less than).</li></ul><pre>console.log(5 &gt; 3); // true<br>console.log(5 &lt; 3); // false</pre><p><strong>3. Logical Operators</strong>: Combine answers.</p><ul><li>&amp;&amp; (AND):</li></ul><pre>console.log(true &amp;&amp; false); // false</pre><ul><li>|| (OR)</li></ul><p>The <strong>OR</strong> operator checks if <strong>at least one condition</strong> is true.</p><p>i. If <strong>one or both are true</strong>, the result is true.</p><p>ii . If <strong>both are false</strong>, the result is false.</p><pre>let isRaining = false;<br>let hasUmbrella = true;<br><br>if (isRaining || hasUmbrella) {<br>  console.log(&quot;You can go outside!&quot;); // This will run because hasUmbrella is true.<br>} else {<br>  console.log(&quot;Better stay indoors.&quot;);<br>}</pre><p>In this example:</p><p>iii. If either isRaining is true OR hasUmbrella is true, you can go outside.</p><ul><li>! (NOT).</li></ul><p>The <strong>NOT</strong> operator flips the truth:</p><p>i. true becomes false.</p><p>ii. false becomes true.</p><pre>let isHungry = false;<br><br>if (!isHungry) {<br>  console.log(&quot;You are not hungry!&quot;); // This will run because !false is true.<br>} else {<br>  console.log(&quot;You are hungry!&quot;);<br>}</pre><p>In this example:</p><p>iii. !isHungry changes false to true. So, &quot;You are not hungry!&quot; is printed</p><h3>4. Let’s Build Something Fun!</h3><p>Here’s a simple example using everything we learned:</p><pre>let name = &quot;Sam&quot;;  <br>let age = 5;  <br>let isHappy = true;  <br><br>if (age &gt; 3 &amp;&amp; isHappy) {<br>  console.log(name + &quot; is having a great day!&quot;);  <br>} else {<br>  console.log(name + &quot; needs more toys!&quot;);  <br>}</pre><h3>Final Thoughts</h3><p>Now you know what variables, data types, and operators are in JavaScript. They are the building blocks of coding. Keep experimenting and playing with these concepts to get better.</p><p><strong>Happy coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29d423950bbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide to Module Federation in Next.js with Tailwind CSS]]></title>
            <link>https://medium.com/@shamimaAlina/step-by-step-guide-to-module-federation-in-next-js-with-tailwind-css-71913dce48f6?source=rss-1d1a686cf49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/71913dce48f6</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[module-federation]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[Shamima Alina]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 17:12:38 GMT</pubDate>
            <atom:updated>2024-12-20T17:26:25.658Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usS0WIogDp-8t0RRbnDvEg.png" /></figure><p>Module Federation allows developers to share code dynamically between multiple applications, making it a powerful tool for micro-frontend architectures. In this guide, we’ll set up Module Federation in a Next.js App project using Webpack and Tailwind CSS for styling. Let’s dive in!</p><p>We’ll build two Next.js apps:</p><ul><li><strong>host-app</strong>: Consumes shared components.</li><li><strong>remote-app</strong>: Provides shared components.</li></ul><p>We’ll configure Webpack for Module Federation and use a shared Tailwind CSS setup to style both apps.</p><h3>Step 1: Set Up the Applications</h3><p>Create Two Next.js Apps</p><p>Run the following commands to create two Next.js applications:</p><pre>npx create-next-app@latest host-app</pre><pre>npx create-next-app@latest remote-app</pre><p>Navigate into each directory and install the necessary dependencies:</p><pre>cd host-app &amp;&amp; npm install<br>npm install webpack @module-federation/nextjs-mf</pre><pre>cd remote-app &amp;&amp; npm install<br>npm install webpack @module-federation/nextjs-mf</pre><h3>Step 2: Add Webpack Configurations for Module Federation</h3><h3>In remote-app</h3><p>Create a webpack.config.js file in the root directory:</p><pre>const { NextFederationPlugin } = require(&#39;@module-federation/nextjs-mf&#39;);<br><br>module.exports = {<br>  webpack(config, { isServer }) {<br>    config.plugins.push(<br>      new NextFederationPlugin({<br>        name: &#39;remoteApp&#39;,<br>        filename: &#39;remoteEntry.js&#39;, <br>        exposes: {<br>          &#39;./Button&#39;: &#39;./src/components/Button.js&#39;, <br>        },<br>    <br>        shared: {<br>          react: { singleton: true, eager: true, requiredVersion: false },<br>          &#39;react-dom&#39;: { singleton: true, eager: true, requiredVersion: false },<br>          tailwindcss: { singleton: true, eager: true, requiredVersion: false },<br>          &#39;postcss-loader&#39;: { singleton: true, eager: true, requiredVersion: false },<br>        },<br>        <br>        <br>      })<br>    );<br><br>    return config;<br>  },<br>};</pre><ol><li>Create a Button component to share:</li></ol><pre>// components/Button.js<br>const Button = () =&gt; &lt;button className=&quot;btn&quot;&gt;Shared Button&lt;/button&gt;;<br>export default Button;</pre><h3>In host-app</h3><p>Create a webpack.config.js file in the root directory:</p><pre>const { NextFederationPlugin } = require(&#39;@module-federation/nextjs-mf&#39;);<br><br>module.exports = {<br>  webpack(config, { isServer }) {<br>    config.plugins.push(<br>      new NextFederationPlugin({<br>        name: &#39;hostApp&#39;,<br>        filename: &#39;remoteEntry.js&#39;,<br>        remotes: {<br>          remoteApp: &#39;remoteApp@http://localhost:3001/remoteEntry.js&#39;,<br>        },<br>        shared: {<br>          react: { singleton: true, eager: true, requiredVersion: false },<br>          &#39;react-dom&#39;: { singleton: true, eager: true, requiredVersion: false },<br>          tailwindcss: { singleton: true, eager: true, requiredVersion: false },<br>          &#39;postcss-loader&#39;: { singleton: true, eager: true, requiredVersion: false },<br>        },<br>        <br>        <br>      })<br>    );<br><br>    return config;<br>  },<br>};</pre><ol><li>Use the shared Button component:</li></ol><pre> // pages/index.js<br>import dynamic from &#39;next/dynamic&#39;;<br><br>const RemoteButton = dynamic(() =&gt; import(&#39;remoteApp/Button&#39;), { ssr: false });<br><br>export default function Home() {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Host Application&lt;/h1&gt;<br>      &lt;RemoteButton /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Step 3: Configure Shared Tailwind CSS</h3><p>We’ll use a shared Tailwind CSS configuration file in the root directory to ensure consistent styling across both apps.</p><h4>i. Create a Shared Tailwind Config</h4><p>In the root folder (outside both apps), create a (shared-config) folder to centralize the Tailwind config file: <strong>shared-config/tailwind.config.js</strong>:</p><pre>/** @type {import(&#39;tailwindcss&#39;).Config} */<br>module.exports = {<br>  content: [<br>    &quot;../hostApp/src/**/*.{js,ts,jsx,tsx,mdx}&quot;,<br>    &quot;../remoteApp/src/**/*.{js,ts,jsx,tsx,mdx}&quot;,<br>  ],<br>  theme: {<br>    extend: {<br>      colors: {<br>        background: &quot;var(--background)&quot;,<br>        foreground: &quot;var(--foreground)&quot;,<br>      },<br>    },<br>  },<br>  plugins: [],<br>};</pre><h4>ii. Update Each Project’s Tailwind Config</h4><p>Update hostApp and remoteApp to extend the shared configuration.</p><p>For hostApp/tailwind.config.js:</p><pre>const sharedConfig = require(&quot;../shared-config/tailwind.config&quot;);<br><br>module.exports = {<br>  ...sharedConfig,<br>  content: [...sharedConfig.content],<br>};</pre><p>For remoteApp/tailwind.config.js:</p><pre>const sharedConfig = require(&quot;../shared-config/tailwind.config&quot;);<br><br>module.exports = {<br>  ...sharedConfig,<br>  content: [...sharedConfig.content],<br>};</pre><h4>iii. Import Shared Variables in Each Project</h4><p>Create a variables.css file in the shared-config folder for shared CSS variables:</p><pre>/* shared-config/variables.css */<br>:root {<br>  --background: #f9f9f9;<br>  --foreground: #333333;<br>}</pre><p>In hostApp and remoteApp, update the global CSS file to include the shared variables.</p><p><strong>For </strong><strong>hostApp/styles/globals.css</strong>:</p><pre>@import &quot;../../shared-config/variables.css&quot;; //adjust your path<br><br>/* Other global styles */</pre><p><strong>For </strong><strong>remoteApp/styles/globals.css</strong>:</p><pre>@import &quot;../../shared-config/variables.css&quot;;<br><br>/* Other global styles */</pre><h3>Step 4: Run the Applications</h3><p>Start remote-app</p><pre>npm run dev</pre><p>Start host-app</p><pre>npm run dev</pre><p>Visit <a href="http://localhost:3000/">http://localhost:3000</a> to see the host-app consuming the shared Button component from the remote-app.</p><h3>Troubleshooting</h3><h4>Common Errors and Solutions</h4><ol><li><strong>Version Mismatch</strong>: Ensure the versions of React, React-DOM, and Webpack are consistent across both applications.</li><li><strong>Module Not Found</strong>: Double-check the paths in exposes and remotes configurations.</li><li><strong>Tailwind CSS Issues</strong>: Verify the content paths in the Tailwind configuration.</li></ol><h3>Conclusion</h3><p>By following this guide, you’ve successfully implemented a basic Module Federation setup in Next.js with Webpack and Tailwind CSS. This setup enables dynamic component sharing, independent deployment, and scalability for your applications. As a next step, consider integrating additional shared components or deploying this setup in a production environment.</p><p>Happy coding 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71913dce48f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>