<?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: Smriti Singh</title>
    <description>The latest articles on DEV Community by Smriti Singh (@smriti_webdev).</description>
    <link>https://dev.to/smriti_webdev</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%2F1540802%2F68250ea0-ef25-487d-a80f-d523aa55aaa3.jpg</url>
      <title>DEV Community: Smriti Singh</title>
      <link>https://dev.to/smriti_webdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smriti_webdev"/>
    <language>en</language>
    <item>
      <title>🖼️ Frontend Challenge Submission: Cubicle Chronicles – A Slice of Office Life</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Sat, 19 Jul 2025 08:08:07 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/frontend-challenge-submission-cubicle-chronicles-a-slice-of-office-life-19b7</link>
      <guid>https://dev.to/smriti_webdev/frontend-challenge-submission-cubicle-chronicles-a-slice-of-office-life-19b7</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/frontend/axero"&gt;Frontend Challenge: Office Edition sponsored by Axero, CSS Art: Office Culture&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎨 Inspiration&lt;/strong&gt;&lt;br&gt;
"Cubicle Chronicles" is a CSS art piece that captures the essence of everyone's office life — the desk clutter, the glowing screen, coffee breaks, the water cooler by the side, and the never-ending meetings, mostly stand-up calls. I wanted to recreate a scene that feels both familiar and fun for anyone who’s worked in an office (remote or IRL).&lt;/p&gt;

&lt;p&gt;🧪 Demo&lt;br&gt;
👉 Live Demo: CodePen – &lt;a href="https://codepen.io/creative-coder/pen/bNVEbPR" rel="noopener noreferrer"&gt;https://codepen.io/creative-coder/pen/bNVEbPR&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a preview of the scene:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1jaor1nms74k8ag6n24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1jaor1nms74k8ag6n24.png" alt=" " width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Journey&lt;/strong&gt;&lt;br&gt;
Creating this CSS artwork was a blend of creativity and challenge. I started by sketching a basic layout of an office cubicle and then built it piece-by-piece using only HTML and CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✏️ Process Highlights:&lt;/strong&gt;&lt;br&gt;
Cubicle Structure: Designed with divs representing the walls and desk layout&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Monitor &amp;amp; Code:&lt;/code&gt; Simulated a developer’s screen showing a loop of writeCode() and drinkCoffee()&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Water Cooler &amp;amp; Coffee Mug:&lt;/code&gt; Added animated bubbles and subtle styling for realism&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Post-it Notes:&lt;/code&gt; Used absolute positioning to place floating sticky notes with reminders&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Animated Plant &amp;amp; Clock:&lt;/code&gt; Brought life to the cubicle with subtle plant movement and ticking clock hands&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Keyboard:&lt;/code&gt; Dynamically generated with JavaScript for added interactivity&lt;/p&gt;

&lt;p&gt;👩‍💻 Sample HTML Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="monitor"&amp;gt;
  &amp;lt;div class="monitor-screen"&amp;gt;
    &amp;lt;div class="screen-content"&amp;gt;
      &amp;lt;div class="code-line"&amp;gt;function work() {&amp;lt;/div&amp;gt;
      &amp;lt;div class="code-line"&amp;gt; while(true) {&amp;lt;/div&amp;gt;
      &amp;lt;div class="code-line"&amp;gt; writeCode();&amp;lt;/div&amp;gt;
      &amp;lt;div class="code-line"&amp;gt; drinkCoffee();&amp;lt;/div&amp;gt;
      &amp;lt;div class="code-line"&amp;gt; attendMeeting();&amp;lt;/div&amp;gt;
      &amp;lt;div class="code-line"&amp;gt; }&amp;lt;/div&amp;gt;
      &amp;lt;div class="code-line"&amp;gt;}&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🎯 What I Learned&lt;/strong&gt;&lt;br&gt;
Deepened my understanding of CSS positioning, transformations, and animations&lt;/p&gt;

&lt;p&gt;Gained appreciation for how small design touches (like shadows, reflections, or sticky notes) can elevate an entire scene&lt;/p&gt;

&lt;p&gt;Practiced writing clean, component-like HTML structure even in pure CSS art projects&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧑‍🤝‍🧑 Team&lt;/strong&gt;&lt;br&gt;
This was a solo submission, but inspired by every coworker who’s ever said, "Did you get my email?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📜 License&lt;/strong&gt;&lt;br&gt;
Feel free to remix or build upon this idea — all code is open-source and available via the CodePen link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for visiting my virtual cubicle! 👩‍💻☕&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>css</category>
    </item>
    <item>
      <title>🌿 Frontend Challenge Submission: The Hub – A Modern Intranet Portal</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Fri, 18 Jul 2025 13:01:31 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/frontend-challenge-submission-the-hub-a-modern-intranet-portal-666</link>
      <guid>https://dev.to/smriti_webdev/frontend-challenge-submission-the-hub-a-modern-intranet-portal-666</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/frontend/axero"&gt;Frontend Challenge: Office Edition sponsored by Axero, Holistic Webdev: Office Space&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 What I Built&lt;/strong&gt;&lt;br&gt;
"The Hub" is a sleek, eco-inspired intranet portal tailored to improve employee experience and simplify access to internal tools and information. Key features include:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Personalized Dashboard with user-specific greetings&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Quick Access Toolbar for common tasks like timesheets, time off, and expenses&lt;/p&gt;

&lt;p&gt;Document Management System with color-coded categories for easy navigation&lt;/p&gt;

&lt;p&gt;Company News Feed showcasing featured announcements&lt;/p&gt;

&lt;p&gt;Interactive Calendar with event management via FullCalendar.js&lt;/p&gt;

&lt;p&gt;Fully Responsive Layout optimized for mobile, tablet, and desktop screens&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔗 Live Demo&lt;/strong&gt;&lt;br&gt;
👉 View Demo on CodePen - &lt;a href="https://codepen.io/creative-coder/pen/EaVVqZZ" rel="noopener noreferrer"&gt;https://codepen.io/creative-coder/pen/EaVVqZZ&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Development Journey&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Design &amp;amp; Planning&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a nature-themed UI using calming greens and soft shadows&lt;/li&gt;
&lt;li&gt;Focused on accessibility and readability throughout the design&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Component Architecture&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Built modular and reusable card components&lt;/li&gt;
&lt;li&gt;Implemented hover animations and click effects for better interactivity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Feature Implementation&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrated FullCalendar.js with mock event data&lt;/li&gt;
&lt;li&gt;Used a card-based layout to organize multiple features cleanly&lt;/li&gt;
&lt;li&gt;Performed responsive testing to ensure cross-device compatibility&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code Snippet&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="icon-box"&amp;gt;
  &amp;lt;i class="fas fa-clock"&amp;gt;&amp;lt;/i&amp;gt;
  &amp;lt;div&amp;gt;Time Sheets&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

// FullCalendar initialization
document.addEventListener('DOMContentLoaded', function() {
  var calendar = new FullCalendar.Calendar(calendarEl, {
    initialView: 'dayGridMonth',
    events: [
      {
        title: 'Team Standup',
        start: new Date()
      }
    ]
  });
  calendar.render();
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpnbxtm089mx1dlk5vzd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpnbxtm089mx1dlk5vzd.png" alt=" " width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 Key Challenges &amp;amp; Solutions&lt;/strong&gt;&lt;br&gt;
Challenge: Differentiating document categories visually&lt;br&gt;
Solution: Created a harmonious yet high-contrast color palette&lt;/p&gt;

&lt;p&gt;Challenge: Calendar integration without backend support&lt;br&gt;
Solution: Used client-side event management via FullCalendar.js&lt;/p&gt;

&lt;p&gt;Challenge: Balancing feature richness with visual simplicity&lt;br&gt;
Solution: Adopted a consistent card-based layout and spacing system&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank you for checking out my project! Feedback is always welcome. 😊&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>frontendchallenge</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>📅 Day 10: Project Day – Build a Small App</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Fri, 18 Jul 2025 10:12:28 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/day-10-project-day-build-a-small-app-mac</link>
      <guid>https://dev.to/smriti_webdev/day-10-project-day-build-a-small-app-mac</guid>
      <description>&lt;p&gt;&lt;strong&gt;Welcome to the final day of the 10-Day JavaScript Learning Challenge! 🎉&lt;/strong&gt;&lt;br&gt;
You’ve explored the core concepts of JavaScript — from variables, loops, and functions to arrays, objects, and DOM manipulation. Now it’s time to bring it all together with a mini project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 Why a Project?&lt;/strong&gt;&lt;br&gt;
Projects are the best way to solidify your learning. They give you hands-on experience and help you understand how different JavaScript concepts work together in real-world scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Mini Project: Build a “To-Do List”&lt;/strong&gt;&lt;br&gt;
Today’s goal is to build a simple, yet powerful To-Do List App using plain JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add new tasks&lt;/li&gt;
&lt;li&gt;Mark tasks as completed&lt;/li&gt;
&lt;li&gt;Delete tasks&lt;/li&gt;
&lt;li&gt;Save tasks to localStorage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Concepts You’ll Apply:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM manipulation (querySelector, classList, innerHTML)&lt;/li&gt;
&lt;li&gt;Event handling (addEventListener)&lt;/li&gt;
&lt;li&gt;Functions and scope&lt;/li&gt;
&lt;li&gt;Arrays and objects&lt;/li&gt;
&lt;li&gt;Conditional logic&lt;/li&gt;
&lt;li&gt;Looping over data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🪄 Project Skeleton (HTML)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="todo-app"&amp;gt;
  &amp;lt;h2&amp;gt;📝 My To-Do List&amp;lt;/h2&amp;gt;
  &amp;lt;input type="text" id="taskInput" placeholder="Add a new task" /&amp;gt;
  &amp;lt;button id="addTaskBtn"&amp;gt;Add Task&amp;lt;/button&amp;gt;
  &amp;lt;ul id="taskList"&amp;gt;&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💻 JavaScript Logic (Basic Setup)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const taskInput = document.getElementById('taskInput');
const addTaskBtn = document.getElementById('addTaskBtn');
const taskList = document.getElementById('taskList');

addTaskBtn.addEventListener('click', function () {
  const taskText = taskInput.value.trim();
  if (taskText !== '') {
    const li = document.createElement('li');
    li.textContent = taskText;

    const deleteBtn = document.createElement('button');
    deleteBtn.textContent = '❌';
    deleteBtn.addEventListener('click', () =&amp;gt; li.remove());

    li.addEventListener('click', () =&amp;gt; {
      li.classList.toggle('completed');
    });

    li.appendChild(deleteBtn);
    taskList.appendChild(li);
    taskInput.value = '';
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✨ Styling with CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.completed {
  text-decoration: line-through;
  color: gray;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧰 Tools You’ll Use&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;1. localStorage.setItem(key, value)&lt;/code&gt;&lt;br&gt;
This saves data to localStorage using a key-value pair.&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;localStorage.setItem('username', 'smriti');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;2. localStorage.getItem(key)&lt;/code&gt;&lt;br&gt;
This retrieves the data stored by a given key.&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;const name = localStorage.getItem('username');
console.log(name); // "smriti"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;3. JSON.stringify()&lt;/code&gt;&lt;br&gt;
JavaScript objects/arrays can't be stored directly in localStorage. You first need to convert them into strings.&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;const todos = ['task1', 'task2'];
localStorage.setItem('tasks', JSON.stringify(todos));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;4. JSON.parse()&lt;/code&gt;&lt;br&gt;
To get the original object/array back, you convert the string back to a JavaScript format.&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;const storedTasks = JSON.parse(localStorage.getItem('tasks'));
console.log(storedTasks); // ['task1', 'task2']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 So in short:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use localStorage.setItem() to save tasks.&lt;/li&gt;
&lt;li&gt;Convert tasks to a string using JSON.stringify().&lt;/li&gt;
&lt;li&gt;Use localStorage.getItem() to retrieve them.&lt;/li&gt;
&lt;li&gt;Use JSON.parse() to convert them back to an array.&lt;/li&gt;
&lt;li&gt;Load this array when the page loads and rebuild the task list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🌟 Wrap Up&lt;/strong&gt;&lt;br&gt;
This mini project wraps up the challenge, but your JavaScript journey doesn’t end here. Try building more complex apps like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Notes app&lt;/li&gt;
&lt;li&gt;Expense tracker&lt;/li&gt;
&lt;li&gt;Weather app (using APIs)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;💬 Final Thoughts&lt;/strong&gt;&lt;br&gt;
You’ve built a strong foundation in JavaScript in just 10 days. Keep coding, keep building, and never stop exploring!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/smriti_webdev" rel="noopener noreferrer"&gt; &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-yellow.png" alt="Buy Me A Coffee" width="545" height="153"&gt; &lt;/a&gt; If you liked this content, you can &lt;strong&gt;buy me a coffee&lt;/strong&gt; ☕ and support more dev-friendly tutorials.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>todolist</category>
      <category>smallapp</category>
    </item>
    <item>
      <title>Day 9: Events, Event Loop &amp; Promises in JavaScript</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Wed, 16 Jul 2025 09:53:20 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/day-9-events-event-loop-promises-in-javascript-3m1g</link>
      <guid>https://dev.to/smriti_webdev/day-9-events-event-loop-promises-in-javascript-3m1g</guid>
      <description>&lt;p&gt;&lt;strong&gt;Welcome to Day 9!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today we’re diving deep into what makes JavaScript interactive and asynchronous. You’ll learn how events work, what makes JavaScript single-threaded yet powerful, and how to handle async operations using Promises and async/await.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🖱️ JavaScript Events&lt;/strong&gt;&lt;br&gt;
An event is a user or browser action, such as clicking a button, scrolling, typing, or loading the page. JavaScript can "listen" for these events and run code when they happen.&lt;/p&gt;

&lt;p&gt;🎯&lt;code&gt;addEventListener()&lt;/code&gt; – Listening for Events&lt;br&gt;
Use this method to attach functions to elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const btn = document.querySelector(".click-me");

btn.addEventListener("click", function () {
  console.log("Button was clicked!");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🖱️ Common Mouse Events&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;click – when a user clicks&lt;/li&gt;
&lt;li&gt;dblclick – double-click&lt;/li&gt;
&lt;li&gt;mouseover – hover&lt;/li&gt;
&lt;li&gt;mouseout – mouse leaves&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;⌨️ Keyboard Events&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.addEventListener("keydown", function (e) {
  console.log("Key pressed:", e.key);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🌊 Event Bubbling&lt;/strong&gt;&lt;br&gt;
Events bubble up from the element to its parent elements in the DOM tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Bubbling example:
child.addEventListener("click", function (e) {
  e.stopPropagation(); // Prevents bubbling to parent
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📦 Event Delegation&lt;/strong&gt;&lt;br&gt;
Instead of adding listeners to multiple child elements, attach one to the parent and check e.target.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.querySelector("ul").addEventListener("click", function (e) {
  if (e.target.tagName === "LI") {
    console.log("Item:", e.target.textContent);
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧠 The Event Loop &amp;amp; Single-Threaded JavaScript&lt;/strong&gt;&lt;br&gt;
JavaScript is single-threaded, meaning it runs one operation at a time. So how does it handle things like timers, API calls, or animations without freezing the browser?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔁 The Event Loop&lt;/strong&gt;&lt;br&gt;
Here’s how it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript runs code in the call stack.&lt;/li&gt;
&lt;li&gt;Long-running tasks (like setTimeout, fetch) are handled by the browser/web APIs.&lt;/li&gt;
&lt;li&gt;Once done, those tasks go into a callback queue.&lt;/li&gt;
&lt;li&gt;The event loop checks if the stack is clear and pushes queued tasks into it.&lt;/li&gt;
&lt;li&gt;This is how JavaScript handles asynchronous code even though it's single-threaded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🌟 Promises – Managing Asynchronous Tasks&lt;/strong&gt;&lt;br&gt;
A Promise is an object that represents a value that may be available now, later, or never.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fetchData = new Promise((resolve, reject) =&amp;gt; {
  setTimeout(() =&amp;gt; {
    resolve("Data received!");
  }, 1000);
});
fetchData.then((data) =&amp;gt; console.log(data));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;⚡ async/await – Cleaner Way to Handle Promises&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function getData() {
  try {
    const response = await fetchData;
    console.log(response);
  } catch (error) {
    console.error(error);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;async makes a function return a Promise&lt;/li&gt;
&lt;li&gt;await waits for the promise to resolve&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;✅ Mini Task: Simple Counter Using Click Events&lt;/strong&gt;&lt;br&gt;
💻 HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div&amp;gt;
  &amp;lt;button id="decrease"&amp;gt;−&amp;lt;/button&amp;gt;
  &amp;lt;span id="count"&amp;gt;0&amp;lt;/span&amp;gt;
  &amp;lt;button id="increase"&amp;gt;+&amp;lt;/button&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💻 JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const count = document.getElementById("count");
const increase = document.getElementById("increase");
const decrease = document.getElementById("decrease");

let value = 0;

increase.addEventListener("click", () =&amp;gt; {
  value++;
  count.textContent = value;
});

decrease.addEventListener("click", () =&amp;gt; {
  value--;
  count.textContent = value;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 9 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How does addEventListener() work?&lt;/li&gt;
&lt;li&gt;What is the event loop in JavaScript?&lt;/li&gt;
&lt;li&gt;How does JavaScript handle async tasks if it's single-threaded?&lt;/li&gt;
&lt;li&gt;What’s the difference between Promise.then() and async/await?&lt;/li&gt;
&lt;li&gt;What is event delegation, and why is it useful?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🏁 Day 9 Wrap-Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;☕ If you liked this content, you can support me by buying a coffee:&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/smriti_webdev" rel="noopener noreferrer"&gt; &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-yellow.png" alt="Buy Me A Coffee" width="545" height="153"&gt; &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me know when you're ready for Day 10, and I’ll wrap up the series for you in style! 💛&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>eventloop</category>
      <category>javascript</category>
      <category>learnjavascript</category>
    </item>
    <item>
      <title>🔍 GitHub Profile Finder – Built with Bolt</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Wed, 16 Jul 2025 09:07:15 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/github-profile-finder-built-with-bolt-2la0</link>
      <guid>https://dev.to/smriti_webdev/github-profile-finder-built-with-bolt-2la0</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/wlh"&gt;World's Largest Hackathon Writing Challenge&lt;/a&gt;: Building with Bolt.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 Prompt&lt;/strong&gt;&lt;br&gt;
The challenge was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a landing page on GitHub where I can fill in the GitHub username, and click on search; the profile of the particular user should appear.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr4vc3glhj2v80am3pwh3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr4vc3glhj2v80am3pwh3.png" alt=" " width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What followed was an exciting and seamless experience of building this project with the Bolt template.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 Project Overview&lt;/strong&gt;&lt;br&gt;
I built a GitHub Profile Finder—a sleek, responsive, and fully functional web app that allows users to search for any GitHub username and instantly view their public profile details including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Bio&lt;/li&gt;
&lt;li&gt;Avatar&lt;/li&gt;
&lt;li&gt;Followers &amp;amp; Following count&lt;/li&gt;
&lt;li&gt;Repositories&lt;/li&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;Company&lt;/li&gt;
&lt;li&gt;And more!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this is powered by the GitHub REST API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpl8y662mg76s6j8v0p1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpl8y662mg76s6j8v0p1a.png" alt=" " width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Tech Stack&lt;/strong&gt;&lt;br&gt;
Framework: Vite + React&lt;/p&gt;

&lt;p&gt;Styling: Tailwind CSS&lt;/p&gt;

&lt;p&gt;Language: TypeScript&lt;/p&gt;

&lt;p&gt;Linting: ESLint&lt;/p&gt;

&lt;p&gt;API: GitHub REST API&lt;/p&gt;

&lt;p&gt;Bolt template: Provided a clean foundation for development 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjq63vk8b9h970otm5wx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjq63vk8b9h970otm5wx.png" alt=" " width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📁 Project Structure&lt;/strong&gt;&lt;br&gt;
Here’s a peek at the file structure that kept things modular and scalable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
├── public/
│   └── vite.svg                    # Vite logo
├── src/
│   ├── components/                 # React components
│   │   ├── ErrorMessage.tsx        # Error display component
│   │   ├── LoadingSpinner.tsx      # Loading animation component
│   │   ├── SearchForm.tsx          # User search form
│   │   └── UserProfile.tsx         # User profile display
│   ├── services/                   # API services
│   │   └── githubApi.ts            # GitHub API integration
│   ├── types/                      # TypeScript type definitions
│   │   └── github.ts               # GitHub user interface
│   ├── App.tsx                     # Main application component
│   ├── index.css                   # Global styles (Tailwind imports)
│   ├── main.tsx                    # Application entry point
│   └── vite-env.d.ts               # Vite type definitions
├── index.html                      # HTML template
├── package.json                    # Dependencies and scripts
├── tailwind.config.js              # Tailwind CSS configuration
├── tsconfig.json                   # TypeScript configuration
├── vite.config.ts                  # Vite configuration
└── README.md                       # Project documentation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✨ Features&lt;/strong&gt;&lt;br&gt;
✅ Live search for any GitHub username&lt;br&gt;
✅ Error handling for invalid users&lt;br&gt;
✅ Clean, responsive UI with Tailwind CSS&lt;br&gt;
✅ Loading spinner during API fetch&lt;br&gt;
✅ Modular file structure&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 Challenges &amp;amp; Breakthroughs&lt;/strong&gt;&lt;br&gt;
While using Bolt, the AI model itself worked smoothly, but I did face a few friction points on the platform side:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;🛑 Google Sign-In Issues:&lt;/code&gt; I tried signing up with Google twice, but both attempts failed. Eventually, I had to use my GitHub account to get started.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;👻 Browser Extension Glitches:&lt;/code&gt;While AI was generating my project, my Phantom and MetaMask Chrome extensions kept popping up repeatedly—even though I wasn’t interacting with them at all. It disrupted the experience a bit. It might be that this error was due to my browser. Don't know.&lt;/p&gt;

&lt;p&gt;These small bugs aside, once I was inside the workspace, everything worked as expected, and I was able to build and deploy my app with ease using github and netlify.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 Favorite Bolt Features&lt;/strong&gt;&lt;br&gt;
Bolt made it effortless to get started:&lt;/p&gt;

&lt;p&gt;🔥 Vite + React + TS combo out of the box&lt;/p&gt;

&lt;p&gt;🎨 Tailwind pre-configured&lt;/p&gt;

&lt;p&gt;✅ ESLint and TypeScript ready&lt;/p&gt;

&lt;p&gt;🧹 Clean file organization&lt;/p&gt;

&lt;p&gt;It saved hours of setup time and let me focus purely on building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💻 Code Highlight: GitHub API Integration&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/services/githubApi.ts
import { GitHubUser } from '../types/github';

export const fetchGitHubUser = async (username: string): Promise&amp;lt;GitHubUser&amp;gt; =&amp;gt; {
  const response = await fetch(`https://api.github.com/users/${username}`);

  if (!response.ok) {
    if (response.status === 404) {
      throw new Error('User not found. Please check the username and try again.');
    } else if (response.status === 403) {
      throw new Error('API rate limit exceeded. Please try again later.');
    } else {
      throw new Error('Failed to fetch user data. Please try again.');
    }
  }

  return response.json();
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;👥 Team&lt;/strong&gt;&lt;br&gt;
This was an individual submission, but shoutout to the DEV and Bolt teams for making this possible! 🙌&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📸 Preview&lt;/strong&gt;&lt;br&gt;
Here’s what the final product looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2opllj8h9cnemez5p52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2opllj8h9cnemez5p52.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔗 Try It Yourself&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;👉 GitHub Repo:&lt;/code&gt; &lt;a href="https://github.com/thecreativecoder07/github-profile-finder" rel="noopener noreferrer"&gt;https://github.com/thecreativecoder07/github-profile-finder&lt;/a&gt;&lt;br&gt;
&lt;code&gt;👉 Live Demo:&lt;/code&gt; &lt;a href="https://github-profile-finderapp.netlify.app/" rel="noopener noreferrer"&gt;https://github-profile-finderapp.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❤️ Final Thoughts&lt;/strong&gt;&lt;br&gt;
Building with Bolt was overall an exciting and smooth experience. I was able to go from idea to deployment in just a few hours—exactly what a hackathon platform should offer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for reading and happy building! ⚡&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;☕ If you liked this content, you can support me by buying a coffee:&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/smriti_webdev" rel="noopener noreferrer"&gt; &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-yellow.png" alt="Buy Me A Coffee" width="545" height="153"&gt; &lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>wlhchallenge</category>
      <category>bolt</category>
      <category>ai</category>
    </item>
    <item>
      <title>🧠 10-Day JavaScript Challenge: DOM Manipulation Day-8</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Tue, 15 Jul 2025 07:33:00 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-javascript-challenge-dom-manipulation-day-8-20cg</link>
      <guid>https://dev.to/smriti_webdev/10-day-javascript-challenge-dom-manipulation-day-8-20cg</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 8: DOM Manipulation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Welcome to Day 8 of our JavaScript journey!&lt;br&gt;
Today, we're exploring the power of DOM manipulation — the key to making your web pages dynamic and interactive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🌐 What is the DOM?&lt;/strong&gt;&lt;br&gt;
The DOM (Document Object Model) is a representation of your HTML page as a tree-like structure that JavaScript can interact with. It lets you read, change, and update HTML content and styles dynamically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔍 Selecting Elements from the DOM&lt;/strong&gt;&lt;br&gt;
Before modifying anything, you need to select the element in JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;✅ getElementById()&lt;/code&gt;&lt;br&gt;
Selects a single element by its ID.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;p id="greeting"&amp;gt;Hello!&amp;lt;/p&amp;gt;
const message = document.getElementById("greeting");
console.log(message.textContent); // Hello!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;✅ querySelector()&lt;/code&gt;&lt;br&gt;
Selects the first element that matches a CSS selector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="box"&amp;gt;&amp;lt;/div&amp;gt;
const box = document.querySelector(".box");

//You can also select by ID or tag:
document.querySelector("#header");
document.querySelector("h1");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;✅ querySelectorAll()&lt;/code&gt;&lt;br&gt;
Selects all elements that match a selector — returns a NodeList.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
  &amp;lt;li&amp;gt;One&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Two&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;

const items = document.querySelectorAll("li");
console.log(items.length); // 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧱 Changing Text and Styles&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const heading = document.querySelector("h1");

// Change text
heading.textContent = "Welcome to JavaScript DOM";

// Change styles
heading.style.color = "tomato";
heading.style.fontSize = "32px";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🎨 Adding &amp;amp; Removing Classes&lt;/strong&gt;&lt;br&gt;
One of the best ways to control styles dynamically is using classList.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;✅ classList.add()&lt;/code&gt;&lt;br&gt;
Adds a class to the element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const box = document.querySelector(".box");
box.classList.add("active");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;✅ classList.remove()&lt;/code&gt;&lt;br&gt;
Removes a class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;box.classList.remove("active");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This way, you can toggle styles by switching classes defined in your CSS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;✅ Mini Task: Change Page Background Using Class&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;🎯 Task:&lt;/code&gt;&lt;br&gt;
Create a button that, when clicked, applies a class to the &lt;/p&gt; that changes its background color.&lt;br&gt;
For this version, we’ll add the class manually in JS, not using event listeners.

&lt;p&gt;💻 HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body class="light-theme"&amp;gt;
  &amp;lt;button class="switch"&amp;gt;Apply Dark Theme&amp;lt;/button&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💻 CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.light-theme {
  background-color: #ffffff;
}

.dark-theme {
  background-color: #121212;
  color: #f5f5f5;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💻 JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Simulate toggle manually
document.body.classList.remove("light-theme");
document.body.classList.add("dark-theme");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Try writing a conditional check next time to switch themes back and forth!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 8 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What does querySelector() return?&lt;/li&gt;
&lt;li&gt;What is the difference between querySelector() and querySelectorAll()?&lt;/li&gt;
&lt;li&gt;How can you change an element's text using JavaScript?&lt;/li&gt;
&lt;li&gt;How do you apply a class to an element using JS?&lt;/li&gt;
&lt;li&gt;Why might you prefer using classList.add() over setting element.className directly?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🏁 Day 8 Wrap-Up&lt;/strong&gt;&lt;br&gt;
In Day 9, we’ll dive deeper into Forms &amp;amp; Input Handling to create interactive web applications.&lt;/p&gt;

&lt;p&gt;Keep practicing and experimenting with the DOM — it’s where frontend magic happens! 💫&lt;/p&gt;

&lt;p&gt;☕ If you liked this content, you can support me by buying a coffee:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/smriti_webdev" rel="noopener noreferrer"&gt; &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-yellow.png" alt="Buy Me A Coffee" width="545" height="153"&gt; &lt;/a&gt;&lt;/p&gt;

</description>
      <category>dom</category>
      <category>javascript</category>
      <category>learnjavascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🧠 10-Day JS Challenge: Objects &amp; Nested Data Day-7</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Mon, 14 Jul 2025 08:51:50 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-js-challenge-objects-nested-data-day-7-2564</link>
      <guid>https://dev.to/smriti_webdev/10-day-js-challenge-objects-nested-data-day-7-2564</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 7: Objects &amp;amp; Nested Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Welcome to Day 7 of the challenge!&lt;/p&gt;

&lt;p&gt;Today we're diving into objects—a key data structure in JavaScript that helps us store data in the form of key-value pairs. Objects are perfect for representing real-world entities like users, products, or configurations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 What is an Object?&lt;/strong&gt;&lt;br&gt;
An object is a collection of related data and functions (called properties and methods). Each property is a key-value pair.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let user = {
  name: "Smriti",
  age: 24,
  isMember: true
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔍 Accessing Object Properties&lt;/strong&gt;&lt;br&gt;
You can access object properties in two ways:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;1. Dot Notation&lt;/code&gt;&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(user.name); // Smriti
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;2. Bracket Notation&lt;/code&gt;&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(user["age"]); // 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bracket notation is useful when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The key is stored in a variable&lt;/li&gt;
&lt;li&gt;The key has spaces or special characters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🧱 Updating &amp;amp; Adding Properties&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.name = "Aarav";          // Update
user.email = "aarav@email.com"; // Add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;You can also delete properties:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delete user.isMember;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧭 Nested Objects and Arrays&lt;/strong&gt;&lt;br&gt;
Objects can contain other objects and arrays — making it easy to model complex data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let student = {
  name: "Ananya",
  age: 18,
  subjects: ["Math", "Science", "English"],
  address: {
    city: "Delhi",
    pin: 110001
  }
};

console.log(student.subjects[1]);       // "Science"
console.log(student.address.city);      // "Delhi"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❄️ Using Object.freeze() to Lock an Object&lt;/strong&gt;&lt;br&gt;
If you want to make an object read-only, use Object.freeze().&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const settings = {
  theme: "dark",
  fontSize: 16
};

Object.freeze(settings);

settings.theme = "light"; // Ignored!
console.log(settings.theme); // "dark"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Object.freeze() only works at the top level — nested objects remain mutable unless you recursively freeze them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;✅ Mini Task: Create and Print a Student Object&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;🎯 Task:&lt;/code&gt;&lt;br&gt;
Create a student object with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;name&lt;/li&gt;
&lt;li&gt;age&lt;/li&gt;
&lt;li&gt;subjects (an array)&lt;/li&gt;
&lt;li&gt;address (nested object with city and pin)&lt;/li&gt;
&lt;li&gt;Print the information neatly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;💻 Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const student = {
  name: "Aarav",
  age: 20,
  subjects: ["Math", "Physics", "Chemistry"],
  address: {
    city: "Mumbai",
    pin: 400001
  }
};

Object.freeze(student);

console.log("Name:", student.name);
console.log("Age:", student.age);
console.log("Subjects:", student.subjects.join(", "));
console.log("City:", student.address.city);
console.log("PIN Code:", student.address.pin);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 7 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the difference between dot notation and bracket notation?&lt;/li&gt;
&lt;li&gt;How do you add or update properties in an object?&lt;/li&gt;
&lt;li&gt;How can you represent nested data in JavaScript?&lt;/li&gt;
&lt;li&gt;What does Object.freeze() do?&lt;/li&gt;
&lt;li&gt;Can a frozen object be modified? What about its nested values?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🏁 Day 7 Wrap-Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tomorrow in Day 8, we’ll learn about Loops with Objects &amp;amp; Arrays — how to iterate over collections efficiently.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;☕ If you liked this content, you can support me by buying a coffee:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/smriti_webdev" rel="noopener noreferrer"&gt; &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-yellow.png" alt="Buy Me A Coffee" width="545" height="153"&gt; &lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🧠 10-Day JS Challenge: Arrays &amp; Array Methods Day-6</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Sun, 13 Jul 2025 18:26:56 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-js-challenge-arrays-array-methods-day-6-b3b</link>
      <guid>https://dev.to/smriti_webdev/10-day-js-challenge-arrays-array-methods-day-6-b3b</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 6: Arrays &amp;amp; Array Methods&lt;/strong&gt;&lt;br&gt;
Welcome to Day 6 of the challenge!&lt;/p&gt;

&lt;p&gt;Today, we’re diving into one of JavaScript’s most used data structures — the Array. Whether you're storing numbers, strings, or objects, arrays are essential for organizing and working with collections of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📦 What is an Array?&lt;/strong&gt;&lt;br&gt;
An array is a special variable that can hold more than one value at a time — like a list.&lt;/p&gt;

&lt;p&gt;You can think of it as a container that stores items in a specific order, and you can access each item using an index (starting from 0).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Declaring an Array:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let colors = ["red", "green", "blue"];
let numbers = [10, 20, 30, 40];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Accessing Elements:&lt;/strong&gt;&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(colors[0]); // "red"
console.log(numbers[2]); // 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Modifying Elements:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;colors[1] = "yellow"; 
console.log(colors); // ["red", "yellow", "blue"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔧 Common Array Methods in JavaScript&lt;/strong&gt;&lt;br&gt;
JavaScript provides built-in methods to make working with arrays easier and more powerful. Let’s look at some essentials:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;📌 1. push()&lt;/code&gt;&lt;br&gt;
Adds an element to the end of the array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let fruits = ["apple", "banana"];
fruits.push("mango");
console.log(fruits); // ["apple", "banana", "mango"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;📌 2. pop()&lt;/code&gt;&lt;br&gt;
Removes the last element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits.pop();
console.log(fruits); // ["apple", "banana"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;📌 3. unshift()&lt;/code&gt;&lt;br&gt;
Adds an element to the beginning.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits.unshift("orange");
console.log(fruits); // ["orange", "apple", "banana"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;📌 4. shift()&lt;/code&gt;&lt;br&gt;
Removes the first element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits.shift();
console.log(fruits); // ["apple", "banana"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔁 Advanced Array Methods&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;✅ map()&lt;/code&gt;&lt;br&gt;
Creates a new array by applying a function to each item.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let numbers = [1, 2, 3];
let squared = numbers.map(num =&amp;gt; num * num);
console.log(squared); // [1, 4, 9]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;✅ filter()&lt;/code&gt;&lt;br&gt;
Creates a new array with elements that pass a condition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let numbers = [1, 2, 3, 4, 5];
let even = numbers.filter(num =&amp;gt; num % 2 === 0);
console.log(even); // [2, 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Mini Task: Filter Even Numbers from an Array&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;🎯 Task:&lt;/code&gt;&lt;br&gt;
Write a program that filters all even numbers from an array and stores them in a new array.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;💻 Solution:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function filterEven(arr) {
  return arr.filter(num =&amp;gt; num % 2 === 0);
}

let sample = [10, 15, 22, 37, 40, 51];
let evens = filterEven(sample);

console.log(evens); // Output: [10, 22, 40]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try it with different numbers or even as a reusable function in other projects!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shallow Copy vs Deep Copy&lt;/strong&gt;&lt;br&gt;
When copying arrays or objects, it's important to know how deep the copy goes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;🔹 Shallow Copy&lt;/code&gt;&lt;br&gt;
A shallow copy duplicates only the first layer. If the original contains objects or arrays inside, they are still linked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let original = [1, 2, [3, 4]];
let copy = [...original];

copy[2][0] = 99;
console.log(original[2][0]); // 99 (original is affected!)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Common shallow copy methods:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[...] spread operator&lt;/li&gt;
&lt;li&gt;Array.prototype.slice()&lt;/li&gt;
&lt;li&gt;Object.assign()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;🔸 Deep Copy&lt;/code&gt;&lt;br&gt;
A deep copy duplicates all levels of nested structures — no shared references.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let deepOriginal = [1, 2, [3, 4]];
let deepCopy = JSON.parse(JSON.stringify(deepOriginal));

deepCopy[2][0] = 100;
console.log(deepOriginal[2][0]); // 3 (original is safe!)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deep copy is ideal when working with complex data structures that shouldn't be altered accidentally.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ JSON method doesn’t work well with functions, undefined, or circular references.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 6 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is an array in JavaScript, and how is it different from an object?&lt;/li&gt;
&lt;li&gt;How do push() and unshift() differ?&lt;/li&gt;
&lt;li&gt;When would you use map() vs forEach()?&lt;/li&gt;
&lt;li&gt;What does the filter() method return?&lt;/li&gt;
&lt;li&gt;Can you explain the difference between pop() and shift()?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;☕ If you liked this content, you can support me by buying a coffee:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/smriti_webdev" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-yellow.png" alt="Buy Me A Coffee" width="545" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🏁 Day 6 Wrap-Up&lt;/strong&gt;&lt;br&gt;
Arrays are everywhere in JavaScript — from storing lists of users to managing UI components. By mastering these basic and advanced methods, you're getting closer to writing clean, powerful, and expressive code.&lt;/p&gt;

&lt;p&gt;📅 Coming up next in Day 7: We’ll explore Objects &amp;amp; Object Methods&lt;br&gt;
Happy coding! 💻🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>🧠 10-Day Challenge: Day 5 Functions &amp; Scope in JS</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Fri, 11 Jul 2025 11:20:24 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-challenge-day-5-functions-scope-in-js-4h3c</link>
      <guid>https://dev.to/smriti_webdev/10-day-challenge-day-5-functions-scope-in-js-4h3c</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 5: Functions &amp;amp; Scope&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Welcome to Day 5 of the challenge!4&lt;/p&gt;

&lt;p&gt;Today, we’re unlocking the core building blocks of JavaScript: Functions and Scope. Functions help you organize, reuse, and simplify your code — and understanding scope gives you control over your variables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔧 What Is a Function?&lt;/strong&gt;&lt;br&gt;
A function is a reusable block of code that performs a specific task.&lt;br&gt;
You define it once and use it wherever you need it.&lt;/p&gt;

&lt;p&gt;Think of a function like a vending machine:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Insert input → Process → Get output&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;✅ Function Declaration&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet(name) {
  return "Hello, " + name + "!";
}
console.log(greet("Smriti")); // Hello, Smriti!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Function Expression&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const greet = function(name) {
  return "Hi, " + name + "!";
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Function expressions are not hoisted, so you can't call them before they’re defined.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚡ Arrow Function (ES6+)&lt;/strong&gt;&lt;br&gt;
Arrow functions provide a shorter syntax and behave differently with this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const greet = (name) =&amp;gt; {
  return "Hey, " + name + "!";
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the function has only one expression, you can make it even shorter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const greet = name =&amp;gt; "Hey, " + name + "!";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔄 Parameters vs Arguments&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Parameters:&lt;/strong&gt; Variables listed in the function definition&lt;br&gt;
&lt;code&gt;function greet(name)&lt;/code&gt; → &lt;code&gt;name&lt;/code&gt; is a parameter&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Arguments:&lt;/strong&gt; Actual values passed when calling the function&lt;br&gt;
&lt;code&gt;greet("Smriti")&lt;/code&gt; → &lt;code&gt;"Smriti"&lt;/code&gt; is an argument&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔁 The return Keyword&lt;/strong&gt;&lt;br&gt;
The return keyword is used to output a value from a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function add(a, b) {
  return a + b;
}
console.log(add(3, 4)); // 7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no return, the function returns undefined.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📦 Scope in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Scope determines where your variables can be accessed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;✅ Function Scope&lt;/strong&gt;&lt;br&gt;
Variables declared with var are function-scoped:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function showMessage() {
  var message = "Hello";
  console.log(message);
}
// message is not accessible outside
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Block Scope&lt;/strong&gt;&lt;br&gt;
let and const are block-scoped:&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) {
  let msg = "Inside block";
  const x = 42;
}
// msg and x are not accessible here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🔄 Normal Function vs Arrow Function: What's the Difference?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4pxhii7xdqqvkgrjs50.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp4pxhii7xdqqvkgrjs50.png" alt=" " width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Mini Task: Factorial Function&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a function that calculates the factorial of a number.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;💡 Factorial of 5 = 5 × 4 × 3 × 2 × 1 = 120&lt;/p&gt;

&lt;p&gt;💻 Solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function factorial(n) {
  let result = 1;
  for (let i = 1; i &amp;lt;= n; i++) {
    result *= i;
  }
  return result;
}

console.log(factorial(5)); // 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try writing the same using a recursive function!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 5 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What’s the difference between a function declaration and a function expression?&lt;/li&gt;
&lt;li&gt;Explain the difference between parameters and arguments.&lt;/li&gt;
&lt;li&gt;What does the return keyword do in a function?&lt;/li&gt;
&lt;li&gt;What is the difference between function scope and block scope?&lt;/li&gt;
&lt;li&gt;What are the key differences between arrow functions and regular functions?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🎉 That’s a Wrap for Day 5!&lt;/strong&gt;&lt;br&gt;
Now you understand how to create and use functions, pass and return values, and manage variable visibility through scope.&lt;br&gt;
Functions = power + reusability.&lt;/p&gt;

&lt;p&gt;👉 Coming up in Day 6: Arrays &amp;amp; Array Methods—where we’ll learn how to store and work with lists of data.&lt;/p&gt;

&lt;p&gt;Keep coding, and share your factorial function below, which you wrote with a different logic! 💪💻&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>🧠 10-Day Challenge : Loops in JavaScript Day-4</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Thu, 10 Jul 2025 12:40:45 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-challenge-loops-in-javascript-day-4-2hh6</link>
      <guid>https://dev.to/smriti_webdev/10-day-challenge-loops-in-javascript-day-4-2hh6</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 4: Mastering Loops in JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Welcome to Day 4 of the challenge!&lt;br&gt;
Today we unlock one of JavaScript’s most powerful tools: loops — a way to make your code do more with less.&lt;/p&gt;

&lt;p&gt;A loop in JavaScript is a control structure that allows you to execute a block of code repeatedly as long as a specified condition is true.&lt;/p&gt;

&lt;p&gt;Instead of writing repetitive code manually, loops help you automate tasks — like printing numbers, processing items in a list, or checking for conditions.&lt;/p&gt;

&lt;p&gt;🏃 Why Loops?&lt;br&gt;
Imagine you were asked to print numbers from 1 to 100.&lt;br&gt;
Would you really write:&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(1);
console.log(2);
console.log(3);
// ...
console.log(100);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No way!&lt;br&gt;
Instead, we use loops to repeat actions efficiently.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;🔁 The 3 Main Loops in JavaScript&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;✅ 1. for loop&lt;/strong&gt;&lt;br&gt;
Great when you know how many times to repeat.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 1; i &amp;lt;= 5; i++) {
  console.log("Step:", i);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 2. while loop&lt;/strong&gt;&lt;br&gt;
Used when you want to repeat while a condition is true.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let i = 1;
while (i &amp;lt;= 5) {
  console.log("While Step:", i);
  i++;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 3. do...while loop&lt;/strong&gt;&lt;br&gt;
Runs at least once, even if the condition is false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let i = 6;
do {
  console.log("Do-While Step:", i);
  i++;
} while (i &amp;lt;= 5);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;⛔ break and continue&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;✅ break – exits the loop immediately&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 1; i &amp;lt;= 10; i++) {
  if (i === 5) break;
  console.log(i); // Stops at 4
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ continue – skips current iteration&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 1; i &amp;lt;= 5; i++) {
  if (i === 3) continue;
  console.log(i); // Skips 3
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;✅ Mini Task:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Print All Even Numbers from 1 to 50&lt;br&gt;
Your challenge: Loop from 1 to 50 and print only even numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Solution 1 (for loop):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 1; i &amp;lt;= 50; i++) {
  if (i % 2 === 0) {
    console.log(i);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Solution 2 (while loop):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let i = 2;
while (i &amp;lt;= 50) {
  console.log(i);
  i += 2;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❓ Interview Questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What’s the difference between a for loop and a while loop?&lt;/li&gt;
&lt;li&gt;When would you prefer a do...while loop?&lt;/li&gt;
&lt;li&gt;What does break do inside a loop?&lt;/li&gt;
&lt;li&gt;What does continue do?&lt;/li&gt;
&lt;li&gt;Can you print numbers 1 to 100 using just one loop?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🎯 That’s a wrap for Day 4!&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Tomorrow, in Day 5, we’ll explore Functions &amp;amp; Scope — a major step toward writing cleaner, reusable code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Keep learning. Keep building. 💪&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>devchallenge</category>
    </item>
    <item>
      <title>🧠 10-Day Challenge: Day-3 Conditional Statements</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Wed, 09 Jul 2025 13:24:00 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-challenge-day-3-conditional-statements-2eon</link>
      <guid>https://dev.to/smriti_webdev/10-day-challenge-day-3-conditional-statements-2eon</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 3: Conditional Statements&lt;/strong&gt;&lt;br&gt;
Welcome to Day 3 of our JavaScript Learning Challenge! 🧠&lt;br&gt;
Today, we’re stepping into the world of decisions in JavaScript — using conditional statements to control the flow of your program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🤔 What Are Conditional Statements?&lt;/strong&gt;&lt;br&gt;
Conditional statements allow you to run different blocks of code depending on whether certain conditions are true or false.&lt;/p&gt;

&lt;p&gt;Think of it like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“If it’s raining, take an umbrella. Else, wear sunglasses.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;✅ if Statement&lt;br&gt;
The most basic decision-making syntax.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 18;

if (age &amp;gt;= 18) {
  console.log("You are eligible to vote!");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ if...else Statement&lt;br&gt;
Use this when you need two different paths.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 16;

if (age &amp;gt;= 18) {
  console.log("You can vote.");
} else {
  console.log("You are not eligible to vote yet.");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ else if Statement&lt;br&gt;
For checking multiple conditions in sequence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let score = 85;

if (score &amp;gt;= 90) {
  console.log("Grade: A");
} else if (score &amp;gt;= 80) {
  console.log("Grade: B");
} else if (score &amp;gt;= 70) {
  console.log("Grade: C");
} else {
  console.log("Grade: D");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Ternary Operator (Shorthand for if...else)&lt;br&gt;
A more compact syntax for simple decisions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 20;
let message = age &amp;gt;= 18 ? "You Can Drive" : "You Cannot Drive!";
console.log(message);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Example: Voting Eligibility Checker&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a JavaScript program that checks whether a person is eligible to vote based on their age.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🧪 Requirements:&lt;br&gt;
If age is 18 or above, print "You can vote!"&lt;br&gt;
If age is below 18, print "You are too young to vote."&lt;/p&gt;

&lt;p&gt;🧠 Example Solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = prompt("Enter your age:");
age = Number(age);

if (age &amp;gt;= 18) {
  console.log("You can vote!");
} else {
  console.log("You are too young to vote.");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using Ternary Operator&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(age &amp;gt;= 18 ? "You can vote!" : "You are too young to vote.");

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 3 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What’s the difference between if, else if, and else?&lt;/li&gt;
&lt;li&gt;When should you use a ternary operator over an if...else block?&lt;/li&gt;
&lt;li&gt;How does JavaScript evaluate multiple conditions in a chain?&lt;/li&gt;
&lt;li&gt;What happens if no condition in an if...else if chain is true?&lt;/li&gt;
&lt;li&gt;What’s the output of:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 18;
console.log(age &amp;gt;= 18 ? "Yes" : "No");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🎉 Awesome! You’ve now mastered conditional logic in JavaScript.&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Tomorrow in Day 4, we’ll explore Loops — the magic behind repetition and iteration in code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>learning</category>
    </item>
    <item>
      <title>🧠 10-Day JavaScript Learning Challenge - Day2</title>
      <dc:creator>Smriti Singh</dc:creator>
      <pubDate>Tue, 08 Jul 2025 11:31:52 +0000</pubDate>
      <link>https://dev.to/smriti_webdev/10-day-javascript-learning-challenge-day2-41lj</link>
      <guid>https://dev.to/smriti_webdev/10-day-javascript-learning-challenge-day2-41lj</guid>
      <description>&lt;p&gt;&lt;strong&gt;📅 Day 2: Data Types &amp;amp; Operators&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Welcome back to Day 2 of the JavaScript Learning Challenge! 👋&lt;br&gt;
Now that you've learned how to set up JavaScript and print output in the console, it’s time to dive deeper into one of the most fundamental aspects of JavaScript: Data Types and Operators.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔢 JavaScript Data Types&lt;/strong&gt;&lt;br&gt;
In JavaScript, everything is a value. Every value has a type, and JavaScript has two broad categories:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 1. Primitive Data Types&lt;/strong&gt;&lt;br&gt;
These are basic and immutable:&lt;/p&gt;

&lt;p&gt;String – Text inside quotes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name = "Smriti";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Number – Whole numbers or decimals&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 25;
let score = 98.6;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boolean – true or false&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isLoggedIn = true;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Undefined – A variable declared but not assigned a value&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let email;
console.log(email); // undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Null – Explicitly empty value&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let address = null;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 2. Non-Primitive (Reference) Data Types&lt;/strong&gt;&lt;br&gt;
These are mutable and store references to values (objects in memory):&lt;/p&gt;

&lt;p&gt;🧱 Object&lt;br&gt;
A collection of key-value pairs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let person = {
  name: "Smriti",
  age: 25,
  isStudent: true
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📦 Array&lt;br&gt;
An ordered list of values (indexed from 0).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let fruits = ["apple", "banana", "mango"];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📜 Function&lt;br&gt;
Functions are also objects!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet() {
  console.log("Hello, world!");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Unlike primitive types, non-primitive types are copied by reference — changing one changes the original.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧮 JavaScript Operators&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;✅ 1. Arithmetic Operators&lt;/strong&gt;&lt;br&gt;
Used for math operations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 10;
let b = 5;

console.log(a + b); // 15
console.log(a - b); // 5
console.log(a * b); // 50
console.log(a / b); // 2
console.log(a % b); // 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 2. Assignment Operators&lt;/strong&gt;&lt;br&gt;
Used to assign or update variable values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 10;
x += 5; // x = x + 5
x -= 2; // x = x - 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 3. Comparison Operators&lt;/strong&gt;&lt;br&gt;
Used to compare values. Returns a boolean (true or false).&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(10 == "10");  // true (loose equality)
console.log(10 === "10"); // false (strict equality)
console.log(5 != 3);       // true
console.log(5 &amp;lt; 10);       // true
console.log(5 &amp;gt;= 5);       // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 4. Logical Operators&lt;/strong&gt;&lt;br&gt;
Used to combine boolean values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isStudent = true;
let hasID = false;

console.log(isStudent &amp;amp;&amp;amp; hasID); // false (AND)
console.log(isStudent || hasID); // true (OR)
console.log(!isStudent);         // false (NOT)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Mini Task: Create a Simple Calculator&lt;/strong&gt;&lt;br&gt;
Let’s build a simple calculator using the arithmetic operators we learned today.&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;let num1 = 12;
let num2 = 4;

console.log("Addition:", num1 + num2);
console.log("Subtraction:", num1 - num2);
console.log("Multiplication:", num1 * num2);
console.log("Division:", num1 / num2);
console.log("Remainder:", num1 % num2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 Try modifying the values of num1 and num2 and re-running the code.&lt;br&gt;
You can even extend this to ask for user input using prompt() (in browsers)!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❓ Interview Questions (Day 2 Topics)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is the difference between primitive and non-primitive data types in JavaScript?&lt;/li&gt;
&lt;li&gt;What are objects and arrays? How are they different?&lt;/li&gt;
&lt;li&gt;What is the result of 5 == "5" and 5 === "5"? Why?&lt;/li&gt;
&lt;li&gt;What does the &amp;amp;&amp;amp; operator do? When would you use it?&lt;/li&gt;
&lt;li&gt;How are variables assigned by value vs. reference in JavaScript?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;🎉 Congrats on completing Day 2!&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Tomorrow in Day 3, we’ll explore Conditional Statements and learn how to make decisions in your code using if, else, and switch.&lt;/em&gt;&lt;/p&gt;

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