<?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 Shraddha Dongol on Medium]]></title>
        <description><![CDATA[Stories by Shraddha Dongol on Medium]]></description>
        <link>https://medium.com/@shraddha.dongol?source=rss-16cc4d49d289------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HG9T3hHsgj3nkkwd</url>
            <title>Stories by Shraddha Dongol on Medium</title>
            <link>https://medium.com/@shraddha.dongol?source=rss-16cc4d49d289------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 11:29:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shraddha.dongol/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[Architecture Overview: MVVM + RTK Query in React]]></title>
            <link>https://medium.com/@shraddha.dongol/architecture-overview-mvvm-rtk-query-in-react-c5821117c0dd?source=rss-16cc4d49d289------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5821117c0dd</guid>
            <category><![CDATA[mvvm-architecture]]></category>
            <category><![CDATA[rtk-query]]></category>
            <category><![CDATA[mvvminreact]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[mvvm]]></category>
            <dc:creator><![CDATA[Shraddha Dongol]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 04:14:10 GMT</pubDate>
            <atom:updated>2026-09-27T04:14:10.023Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog outlines how the <strong>Model-View-ViewModel (MVVM)</strong> pattern is structured and integrated with <strong>RTK Query</strong> in this project’s src directory.</p><h4>Folder Structure Reference</h4><ul><li><strong>models/</strong>: TypeScript interfaces and types representing business data structures (e.g., user.model.ts).</li><li><strong>slice/</strong>: RTK Query API slices and Redux Toolkit slices handling server-state caching, fetching, and mutations.</li><li><strong>view-models/</strong>: Custom hooks (use*.ts) that encapsulate business logic, UI state manipulation, data filtering, and connect to RTK Query hooks.</li><li><strong>views/</strong>: Pure UI React components responsible only for layout, rendering, and passing user interactions to the ViewModel.</li><li><strong>routes/</strong>: Application routing configuration.</li><li><strong>utils/</strong>: Shared helper functions and utility modules.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*5f2QOTj_7WgupTe90ik4MA.png" /></figure><h4><strong>Data Flow Architecture</strong></h4><pre>[ View (UI Component) ] <br>       │<br>       ▼ (Invokes &amp; Observes)<br>[ ViewModel (Custom Hook) ] <br>       │<br>       ├─────────────────────────┐<br>       ▼                         ▼<br>[ RTK Query (`slice/`) ]   [ Local UI State (`useState`) ]<br>       │<br>       ▼<br>[ Backend API / Mock ]</pre><h4>1. Model (src/models/user.model.ts)</h4><p>Defines the shape of the data entity.</p><pre>export interface User {<br>  id: string;<br>  name: string;<br>  email: string;<br>}</pre><h4>2. RTK Query Slice (src/slice/userApi.ts)</h4><p>Handles API communication and caching.</p><pre>import { createApi, fetchBaseQuery } from &#39;@reduxjs/toolkit/query/react&#39;;<br>import { User } from &#39;../models/user.model&#39;;<br>export const userApi = createApi({<br>  reducerPath: &#39;userApi&#39;,<br>  baseQuery: fetchBaseQuery({ baseUrl: &#39;/api&#39; }),<br>  endpoints: (builder) =&gt; ({<br>    getUsers: builder.query&lt;User[], void&gt;({<br>      query: () =&gt; &#39;/users&#39;,<br>    }),<br>  }),<br>});<br>export const { useGetUsersQuery } = userApi;</pre><h4>3. ViewModel (src/view-models/useUserViewModel.ts)</h4><p>Encapsulates data fetching and local business/UI logic.</p><pre>import { useState } from &#39;react&#39;;<br>import { useGetUsersQuery } from &#39;../slice/userApi&#39;;<br>export const useUserViewModel = () =&gt; {<br>  const { data: users, isLoading, error } = useGetUsersQuery();<br>  const [searchQuery, setSearchQuery] = useState(&#39;&#39;);<br>  const filteredUsers = users?.filter((user) =&gt;<br>    user.name.toLowerCase().includes(searchQuery.toLowerCase())<br>  );<br>return {<br>    users: filteredUsers,<br>    isLoading,<br>    error,<br>    searchQuery,<br>    setSearchQuery,<br>  };<br>};</pre><h4>4. View (src/views/UserView.tsx)</h4><p>Pure rendering component free of heavy business or data-fetching logic.</p><pre>import React from &#39;react&#39;;<br>import { useUserViewModel } from &#39;../view-models/useUserViewModel&#39;;<br>export const UserView: React.FC = () =&gt; {<br>  const { users, isLoading, error, searchQuery, setSearchQuery } = useUserViewModel();<br>   if (isLoading) return &lt;div&gt;Loading...&lt;/div&gt;;<br>   if (error) return &lt;div&gt;Failed to load users.&lt;/div&gt;;<br>   return (<br>        &lt;div&gt;<br>          &lt;input<br>            type=&quot;text&quot;<br>            value={searchQuery}<br>            onChange={(e) =&gt; setSearchQuery(e.target.value)}<br>            placeholder=&quot;Filter users...&quot;<br>          /&gt;<br>          &lt;ul&gt;<br>            {users?.map((user) =&gt; (<br>              &lt;li key={user.id}&gt;{user.name}&lt;/li&gt;<br>            ))}<br>          &lt;/ul&gt;<br>        &lt;/div&gt;<br>      );<br>};</pre><h4>Benefits of this Architecture</h4><ul><li><strong>Strict Separation of Concerns:</strong> Components stay clean and declarative. Network state handling lives in RTK Query, while UI behavior lives in ViewModels.</li><li><strong>Enhanced Testability:</strong> ViewModels can be tested independently of React component trees using standard hook testing utilities.</li><li><strong>Scalability:</strong> Easily manage complex client-side transformations and side-effects without cluttering UI components or global Redux stores.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5821117c0dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying Leaflet.js in React]]></title>
            <link>https://medium.com/@shraddha.dongol/simplifying-leaflet-js-in-react-548964b50988?source=rss-16cc4d49d289------2</link>
            <guid isPermaLink="false">https://medium.com/p/548964b50988</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[leaflet]]></category>
            <category><![CDATA[integrate]]></category>
            <dc:creator><![CDATA[Shraddha Dongol]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 04:25:53 GMT</pubDate>
            <atom:updated>2026-07-29T04:25:53.458Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever tried to add a beautiful, interactive map to your React project only to hit a brick wall of dependencies and version mismatches? Yeah, me too. I chose <strong>Leaflet.js</strong> — the lightweight, open-source mapping library — and its React counterpart, <strong>react-leaflet</strong>. What followed was frustrating as my react-leaflet version and my core React version weren&#39;t playing nice.</p><p>Once the versions were aligned, the true power of Leaflet opened up. This guide is for anyone who’s stuck right where I was, or is just starting out.</p><ol><li><strong>Installation &amp; Dependency Alignment</strong></li></ol><p>First things first, lets get our packages installed:</p><pre># Core Map Functionality<br>npm install leaflet react-leaflet<br><br># Optional: For visualizing many markers cleanly<br>npm install react-leaflet-markercluster</pre><p><strong>Tip on Versioning (The Lesson I Learned):</strong> If you run into initial errors, check the <strong>react-leaflet documentation</strong>. It clearly lists which versions of React are compatible with which versions of the library.</p><p>A quick fix might involve installing an older, more stable version:</p><pre>npm install react-leaflet@&lt;version&gt;</pre><p><strong>2</strong>. <strong>The CSS Import</strong></p><p>Leaflet is a purely JavaScript library, but it requires specific <strong>CSS</strong> to properly style the map tiles, markers, and popups. In your file, start by just importing the following:</p><pre>import &#39;leaflet/dist/leaflet.css&#39;;</pre><p><strong>3. Building the Base Map Component</strong></p><p>The entire map structure can be divided into 3 main components:</p><p>&lt;MapContainer&gt;,&lt;TileLayer&gt; and &lt;Marker&gt;</p><pre>//yourfile.jsx<br>import React from &#39;react&#39;;<br>import { MapContainer, TileLayer, Marker, Popup } from &#39;react-leaflet&#39;;<br>import &#39;leaflet/dist/leaflet.css&#39;;<br><br>const MapComponent = () =&gt; {<br>  // Set the initial position (e.g., Kathmandu: 27.70, 85.32)<br>  const initialPosition = [27.70, 85.32];<br>  const zoomLevel = 13; // 1-18, where 18 is zoomed in<br><br>  return (<br>    &lt;MapContainer <br>      center={initialPosition} <br>      zoom={zoomLevel} <br>      scrollWheelZoom={false}<br>      style={{ height: &#39;500px&#39;, width: &#39;100%&#39; }} // Set dimensions!<br>    &gt;<br>      {/* 1. The Tile Layer */}<br>      &lt;TileLayer<br>        attribution=&#39;&amp;copy; &lt;a href=&quot;http://osm.org/copyright&quot;&gt;OpenStreetMap&lt;/a&gt; contributors&#39;<br>        url=&quot;https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png&quot;<br>      /&gt;<br><br>      {/* 2. A Simple Marker */}<br>      &lt;Marker position={initialPosition}&gt;<br>        &lt;Popup&gt;<br>          ABC Cafe<br>        &lt;/Popup&gt;<br>      &lt;/Marker&gt;<br>      <br>    &lt;/MapContainer&gt;<br>  );<br>};<br><br>export default MapComponent;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*Ie5FBKYsleFNhcVDOaApjg.png" /></figure><p><strong>4. Adding Complexity with Marker Clustering(Optional)</strong></p><p>In different projects we may have to add dozens of locations which can clutter the map. So the solution is to use <strong>react-leaflet-markercluster</strong> to automatically group nearby markers into a single icon.</p><pre>import MarkerClusterGroup from &#39;react-leaflet-markercluster&#39;;<br>.<br>.<br>.<br><br>&lt;MapContainer .....&gt;<br>  &lt;TileLayer .... /&gt;<br>    &lt;MarkerClusterGroup&gt;<br>        {/* Marker 1 */}<br>        &lt;Marker position={[27.705, 85.325]}&gt;<br>            &lt;Popup&gt;ABC Cafe&lt;/Popup&gt;<br>        &lt;/Marker&gt;<br>    <br>        {/* Marker 2 */}<br>        &lt;Marker position={[27.710, 85.330]}&gt;<br>            &lt;Popup&gt;XYZ Cafe&lt;/Popup&gt;<br>        &lt;/Marker&gt;<br>        <br>        {/* Add as many markers as you need... */}<br>    <br>    &lt;/MarkerClusterGroup&gt;<br>&lt;/MapContainer&gt;</pre><p><strong>5. Styling and Customization</strong></p><p>We can easily elevate our map by replacing standard markers with branded images using <strong>L.icon()</strong>. Furthermore, we can use the <strong>iconCreateFunction</strong> to style cluster groups, making our data look organized and unique, rather than relying on default library styles.</p><pre>const customIcon = new Icon({<br>  iconUrl: &#39;https://example_icon&#39;,<br>  iconSize: [38, 38],<br>});</pre><pre><br>&lt;MarkerClusterGroup iconCreateFunction={(cluster) =&gt; {<br>    const count = cluster.getChildCount();<br><br>    // Custom HTML for the cluster<br>    return L.divIcon({<br>      html: `<br>        &lt;div class=&quot;cluster-custom&quot;&gt;<br>          &lt;span&gt;${count}&lt;/span&gt;<br>        &lt;/div&gt;<br>      `,<br>      className: &quot;custom-marker-cluster&quot;, <br>      iconSize: L.point(40, 40, true),<br>    });<br>  }}&gt;<br>        <br>   &lt;Marker icon={customIcon}&gt;<br>  .<br>  .<br>  &lt;/Marker&gt;<br>&lt;/MarkerClusterGroup&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*i0nvfUa2Kx2yunthAIYazQ.png" /></figure><p><strong>Congratulations </strong>! We’ve successfully integrated a dynamic, interactive map into our React application using react-leaflet .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=548964b50988" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Crochet made me realize?]]></title>
            <link>https://medium.com/@shraddha.dongol/what-crochet-made-me-realize-5355589abbcf?source=rss-16cc4d49d289------2</link>
            <guid isPermaLink="false">https://medium.com/p/5355589abbcf</guid>
            <dc:creator><![CDATA[Shraddha Dongol]]></dc:creator>
            <pubDate>Thu, 22 Jan 2026 08:31:14 GMT</pubDate>
            <atom:updated>2026-05-17T09:30:15.190Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Learning patience, pain, and my mother’s quiet strength — one stitch at a time</em></p><p>The sound of knitting needles clicking early in the morning is one of my oldest memories. Crochet hooks moved steadily while conversations flowed, tea cooled on the table, and life carried on around her. What she made was never meant to sit on a shelf or wait for praise. It was SURVIVAL. Sweaters to fight winter. Caps for newborns. Gloves and Socks for giving the warmth.</p><p>I didn’t realize it then, but I was watching a woman build a life — loop by loop. To me, it was just <em>what she did</em>. <strong>Her hands were always busy. Her eyes were always counting.</strong></p><blockquote>She didn’t call it art. She called it <strong>WORK.</strong></blockquote><p>There was a rhythm to her work, a discipline I was too young to name. She counted stitches the way others count money or time. She knew when something felt wrong without looking. If a stitch slipped, she would undo rows without frustration — only patience. At the time, I didn’t understand how powerful that quiet persistence was.</p><p>What I <em>did</em> notice was how tired she was. How the work never really ended. How handmade things were often undervalued because they were made at home, quietly, by women whose labor was rarely seen beyond the finished piece. People admired the sweaters and gloves, but not the aching backs, strained eyes, or fingers that worked for hours to create them.</p><p>I grew up around crochet, but not truly inside it. That changed in the first month of 2025, when I decided to learn crochet myself.</p><p>And suddenly, everything felt different.</p><p>I realized how much patience it demands — far more than I had expected. Every stitch required focus. My eyes strained from constant counting, my back ached from leaning forward for too long, and my fingers hurt as they learned to hold the yarn and hook correctly.</p><p>There were moments when my hands cramped and my progress felt painfully slow. Pieces didn’t look the way I imagined them. Yarn split. Tension went wrong. I had to undo my work again and again.</p><p>In that struggle, I finally understood my mother — not just what she made, but who she was while making it. Resilient. Focused. Creating warmth when resources were limited. Turning skill into stability.</p><p>What she did to survive, I now do to reconnect…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*yY8a0NxFGDjvvRuLlB0eag.png" /></figure><p><a href="https://www.instagram.com/threadandloop_/#">:) </a>Do Check <a href="https://www.instagram.com/threadandloop_/#">threadandloop_</a> ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5355589abbcf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Essentials]]></title>
            <link>https://medium.com/@shraddha.dongol/javascript-essentials-d879e30be87e?source=rss-16cc4d49d289------2</link>
            <guid isPermaLink="false">https://medium.com/p/d879e30be87e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[variables]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[datatypes-in-javascript]]></category>
            <dc:creator><![CDATA[Shraddha Dongol]]></dc:creator>
            <pubDate>Fri, 31 Jan 2025 18:03:43 GMT</pubDate>
            <atom:updated>2025-12-14T02:59:32.455Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Beginner’s Guide to Variables, Datatypes, Operators &amp; Functions</h4><p>The key to mastering JavaScript, or any programming language, is to <strong>take it step-by-step </strong>. We’ll begin by building a strong foundation, starting with the essentials like variables, functions, and operators, breaking down each concept one at a time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*uqr-JZsEQZpctbWETYjTiA.png" /></figure><p><strong>1. Variables</strong></p><p>Imagine you have a box where you can put anything inside it like your favourite book, your clothes, your laptop and everything. In programming, a <strong>variable</strong> is like that box.</p><p>But instead of holding physical items, it holds <strong>data</strong> like integer (number), string (words), or Boolean (true/false) values.</p><ul><li><strong>Declaring and initializing a variable:</strong></li></ul><pre>// A box for a number<br>let age;       // Declaring a variable (an empty box)<br>age = 25;      // Putting(initializing) the number 25 into the box<br><br>// A box for storing a word (string)<br>let name = &quot;Shraddha&quot;; // The name box holds the word &quot;Shraddha&quot;<br><br>// A box for storing a true/false value (Boolean)<br>let isLaptopOpened = true; // The isLaptopOpened box holds true</pre><p>We can declare JavaScript in 3 ways : <strong>var, let, </strong>and<strong> const</strong>. They all hold <strong>values</strong>, but they differ in how and where they can be accessed.</p><pre>var greeting = &quot;Hello&quot;;<br> console.log(greeting); // Output: Hello <br><br>let age = 25;<br> console.log(age); // Output: 25 <br><br>const city = &quot;Kathmandu&quot;; <br>console.log(city); // Output: Kathmandu <br><br>// Reassigning let and var <br>greeting = &quot;Hi&quot;;<br>console.log(greeting); // Output: Hi (Before reassign : Hello)<br>age = 30;<br>console.log(age); // Output: 30 (Before reassign : 25)<br><br>// Re-assigning const will throw an error <br>city = &quot;Okhaldhunga&quot;; // Error: Assignment to constant variable.</pre><blockquote>Re-declaration: <strong><em>var</em></strong> can be re-declared, but <strong><em>let</em></strong> and <strong><em>const</em></strong> cannot be re-declared in the same scope.</blockquote><blockquote>Re-assignment: You can re-assign values to <strong><em>var </em></strong>and<strong><em> let</em></strong>, but not to <strong><em>const</em></strong>.</blockquote><p><strong>2. Data Types</strong></p><p><strong>I. Primitive Data Types: </strong>Primitive data types are simple, predefined types in JavaScript. They are <strong>immutable</strong>, meaning their values cannot be changed once assigned, and any modification creates a new value.</p><ul><li><strong>String</strong>: A sequence of characters, like text.</li><li><strong>Number</strong>: Represents numbers, including both whole numbers and decimals.</li><li><strong>Boolean</strong>: Represents true or false values, often used for decision-making.</li><li><strong>BigInt</strong>: Used for very large numbers that go beyond the usual number limit.</li><li><strong>Undefined</strong>: A variable that has been declared but not assigned any value yet.</li><li><strong>Null</strong>: Represents an empty or intentional absence of any value.</li><li><strong>Symbol</strong>: A unique, unchangeable value often used as object keys.</li></ul><pre><br>let age = 20; // Number<br>let temperature = 37.5; // Float<br>let bigNumber = 1234567890123456789012345678901234567890n; // BigInt<br><br>let isActive = true; // Boolean <br><br>let x;<br>console.log(x);  // Undefined<br><br>let data = null; // Null<br><br>let sym = Symbol(&#39;id&#39;); // Symbol</pre><p><strong>II. Non-primitive Data Types:</strong> These are complex types, typically referred to as objects, and they can store multiple values. Unlike primitive data types, they are mutable, meaning their values can be modified after they are created.</p><ul><li><strong>Object</strong>: A collection of key-value pairs (properties) and methods (functions).</li><li><strong>Array</strong>: A list-like collection of ordered elements.</li><li><strong>Function</strong>: A block of reusable code that can be called with specific inputs (arguments).</li><li><strong>Date</strong>: Represents a specific point in time.</li><li><strong>RegExp</strong>: Represents a regular expression used for pattern matching in strings.</li><li><strong>Map</strong>: A collection of key-value pairs where keys can be of any data type (not just strings or symbols).</li><li><strong>Set</strong>: A collection of unique values, where duplicates are automatically removed.</li></ul><pre>let person = { name: &quot;Alice&quot;, age: 20 }; // Object<br><br>let colors = [&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;]; // Array<br><br>function greet() { // Function<br>  console.log(&quot;Hello, World!&quot;);<br>}<br><br>let currentDate = new Date(); // Date<br><br>let pattern = /abc/; // RegExp<br><br>let map = new Map();<br>map.set(&quot;name&quot;, &quot;Alice&quot;);<br>map.set(1, &quot;one&quot;);<br>map.set(true, &quot;boolean&quot;);<br><br>console.log(map); // Output: Map { &#39;name&#39; =&gt; &#39;Alice&#39;, 1 =&gt; &#39;one&#39;, true =&gt; &#39;boolean&#39; }<br><br>let uniqueNumbers = new Set([1, 2, 2, 3, 3, 4, 5, 5]); // Set<br>console.log(uniqueNumbers); // Output: Set { 1, 2, 3, 4, 5 }  //removes duplicate values</pre><blockquote>When a primitive value is assigned to a new variable, a copy of the value is created.</blockquote><blockquote>When a non-primitive values are assigned to a new variable, the reference to the original object is copied, not the actual value.</blockquote><p><strong>3. Operators</strong></p><p>JS operators are the special symbols that allows us to perform different operations like addition, multiplication and so on.</p><pre>2 + 3;  // 5<br>// In this case, the &#39;+&#39; operator adds the two operands(2,3) and <br>// returns the result 5</pre><ul><li>Arithmetic Operators</li></ul><pre><strong>Operator     Meaning</strong><br>+             Addition<br>-             Subtraction<br>*             Multiplication<br>/             Division<br>%             Modulus (Division Remainder)<br>**            Exponentiation (Power)<br>++            Increment (increments by 1)<br>--            Decrement(decrements by 1)</pre><ul><li>Assignment Operators</li></ul><pre><strong>Operator    Example       Same As</strong><br>   =          x = y        x = y          //Assignment Operator<br>  +=         x += y        x = x + y      //Addition Assignment<br>  -=         x -= y        x = x - y      //Subtraction Assignment<br>  *=         x *= y        x = x * y      //Multiplication Assignment<br>  /=         x /= y        x = x / y      //Division Assignment<br>  %=         x %= y        x = x % y      //Remainder Assignment<br>  **=        x **= y       x = x ** y     //Exponentiation Assignment</pre><ul><li>Comparison Operators</li></ul><pre><strong>Operator     Meaning </strong><br>==           Equal to <br>!=           Not equal to <br>&gt;            Greater than <br>&lt;            Less than <br>&gt;=           Greater than or equal to <br>&lt;=           Less than or equal to <br>===          Strictly equal to <br>!==          Strictly not equal to</pre><ul><li>String Operators</li></ul><p>The + operator in JavaScript can either perform <strong>arithmetic addition</strong> when used with numbers or <strong>string concatenation</strong> when one or both operands are strings.</p><pre>// Number + Number = Number<br>let x = 4 + 4; //Output : 8<br><br>// String + Number = String<br>let y = &quot;4&quot; + 4; //Output : 44<br><br>let z = &quot;Hello World&quot; + 4; //Output : Hello World4</pre><ul><li>Logical Operators</li></ul><pre><strong>Operator   Description</strong><br>&amp;&amp;         logical and<br>||         logical or<br>!          logical not</pre><pre>let a = true;<br>let b = false;<br>let resultAND = a &amp;&amp; b; // Output: false<br>let resultOR = a || b; // Output: true</pre><ul><li>Bitwise Operators</li></ul><pre><strong>Operator   Description</strong><br>&amp; (AND)    Compares each bit and returns 1 if both bits are 1.<br>| (OR)     Compares each bit and returns 1 if at least one of the bits is 1.<br>^ (XOR)    Returns 1 if the bits are different, otherwise 0.</pre><pre>let a = 5;  // Binary: 0101<br>let b = 3;  // Binary: 0011<br>let result = a &amp; b; // Output: 1 (Binary: 0001)</pre><ul><li>Ternary Operators</li></ul><p>The ternary operator is a<strong> shortcut for the if-else statement</strong>.</p><pre><strong>condition ? value1 : value2;</strong><br>- If the condition is <strong>true</strong>, it returns the first value (value1), <br>  otherwise, <br>  it returns the second value (value2)</pre><pre>let isTrue = true;<br>let message = isTrue ? &#39;This will be executed&#39; : &#39;This will not be executed&#39;;<br>// Output: &quot;This will be executed&quot;</pre><ul><li>Type Operators</li></ul><pre><strong>Operator      Description</strong><br>typeof        Returns the type of a variable<br>instanceof    Returns true if an object is an instance of an object type</pre><pre>let num = 10;<br>console.log(typeof num); // Output: &quot;number&quot;<br><br>let str = &quot;Hello&quot;;<br>console.log(str instanceof String); // Output: false (because str is a primitive string, not an object)</pre><p><strong>4</strong>. <strong>Functions</strong></p><p>A function is a block of code that you can execute whenever needed. Functions make your code <strong>reusable</strong>, <strong>organized</strong>, and <strong>clean</strong>.</p><pre>function function_name(parameter1, parameter2, parameter3) {<br>// code to be executed<br>}<br><br>- A JavaScript function is defined with the function keyword,<br>- Followed by name of the function, then<br>- Followed by a list of parameters, enclosed in parentheses and separated by commas.(parameter1, parameter2, ...)<br>- The code to be executed is placed inside curly brackets: {}</pre><pre>//Defining a function<br>function square(number) {<br>  return number * number;<br>}<br><br>//Calling or Invoking a function<br>square(5); // Output : 25</pre><p>JavaScript may seem vast and overwhelming at first, but remember — <strong>every expert was once a beginner</strong>. As I mentioned earlier, the key to mastering JavaScript is to <strong>take it step-by-step</strong>.</p><p>Once you’re comfortable with these fundamental concepts, you can slowly <strong>explore the endless possibilities</strong> that JavaScript offers, including powerful frameworks and libraries like <strong>React</strong>, <strong>Vue.js</strong>, and <strong>Node.js</strong>. It’s no surprise that <a href="https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/"><strong>Statista</strong></a> declared <strong>JavaScript</strong> as one of the most powerful programming languages worldwide in 2025, with <strong>66%</strong> of developers using it. This statistic shows just how impactful learning JavaScript can be for your coding journey and career.</p><p><strong>Don’t rush. Take your time. Explore.<br></strong>Each line of code you write, every error you debug, and all the small wins you achieve along the way will add up.</p><p>So let’s start this journey together, and soon enough, we’ll <strong>reach new heights</strong> in JavaScript development!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d879e30be87e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript for Beginners : A Fun Guide to Stepping into the World of Code]]></title>
            <link>https://medium.com/@shraddha.dongol/javascript-for-beginners-a-fun-guide-to-stepping-into-the-world-of-code-9e724e3b1bd9?source=rss-16cc4d49d289------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e724e3b1bd9</guid>
            <dc:creator><![CDATA[Shraddha Dongol]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 15:40:07 GMT</pubDate>
            <atom:updated>2025-01-07T15:40:07.367Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>JavaScript for Beginners : A Fun Guide to Stepping into the World of Code</strong></h3><p>Imagine visiting a website that looks great visually, but doesn’t <strong>respond</strong> when you click a button, or <strong>show animations</strong> when you scroll. Sounds dull, right? That’s where <strong>JavaScript</strong> steps in, it’s the magic behind <strong>interactive and dynamic websites</strong>.</p><p>When I first started learning to code, I remember feeling completely overwhelmed by all the different languages — programming languages like Java, scripting languages like JavaScript, and even markup and styling languages like HTML and CSS. I struggled to understand the differences between them — what was used for logic, what handled structure, and what controlled design. I didn’t know what each one did or how they worked together. But don’t worry, if you’re feeling the same way, you’re <strong>not alone</strong>. It’s perfectly normal, and trust me, it gets clearer with time!</p><p>To make things simple, HTML is used to structure the content, CSS is used to style and design the page, making it look visually appealing and <strong>JavaScript</strong> is what <strong>brings the page to life</strong> by adding <strong>interactivity</strong> and <strong>behavior</strong>.</p><blockquote><em>Let’s take a quick look at JavaScript’s history!</em></blockquote><blockquote>JavaScript was created in <strong>1995</strong> by <strong>Brendan Eich</strong> while working at <strong>Netscape</strong>. Its original name was <strong>Mocha</strong>, which was later changed to <strong>LiveScript</strong>. Finally, it was renamed <strong>JavaScript</strong> .</blockquote><blockquote>Just to clear up any confusion<strong> </strong>— <strong>JavaScript is not the same as Java!</strong></blockquote><blockquote>At that time, <strong>Java</strong>, developed by <strong>Sun Microsystems</strong>, was one of the most popular programming languages. Netscape decided to <strong>ride on Java’s popularity</strong> and renamed LiveScript to JavaScript as part of a <strong>marketing strategy</strong>. But don’t let the name fool you — JavaScript and Java have <strong>very little in common</strong> aside from their names!</blockquote><p>Now that you have a basic idea of what <strong>JavaScript</strong> is, you might be wondering — <strong>where do I even start? </strong>Don’t worry! I’ll guide you through each step, just like someone once guided me when I was a beginner.</p><h4><strong>Step 1 : Setting Up Your Tools</strong></h4><p>Now, don’t let fancy phrases like “Setting Up Your Tools” scare you. It’s not as complicated as it sounds. All it means is that you need a <strong>place to write your code</strong>. One of the most <strong>popular</strong> and <strong>beginner-friendly</strong> text editors is: <strong>Visual Studio Code (VS Code)</strong> — It’s free, super easy to use, and trusted by developers worldwide.</p><p><strong>Get Started with VS Code:</strong></p><ol><li>Download VS Code here — <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a></li><li>Install it just like any other app</li></ol><p><strong>And you’re ready to go!</strong></p><h4><strong>Step 2 : Start it in your browser itself</strong></h4><p>Let’s run your first JavaScript code right inside your browser (no setup required for this!).</p><ol><li>Open <strong>Google Chrome</strong> (or any modern browser).</li><li>Right click anywhere on the page and select <strong>Inspect</strong>.</li><li>Go to the <strong>Console</strong> tab and you’re now in JavaScript’s playground!</li></ol><p>But first let’s follow the <strong>old tradition</strong> that every programmer has done at some point — <strong>Printing “Hello, World!”</strong></p><p>Why? Because it’s like saying <strong>“Hi”</strong> to the coding world and it’s simple, fun, and gives you instant results!</p><pre>console.log(&quot;Hello world!&quot;);</pre><p>Hit enter and BOOM!</p><p>You just wrote your <strong>first line of JavaScript! </strong>Give yourself a pat on the shoulder. Well Done!</p><h4>Step 3: Write Your First Program with me</h4><p>Now let’s create a simple <strong>HTML file</strong> and write our first JavaScript program inside it.</p><ol><li>Open <strong>VS Code</strong> (or any text editor of your choice).</li><li>Create a file called <strong>index.html</strong>.</li><li>Copy and paste this code:</li></ol><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;title&gt;My First JavaScript&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;Welcome to JavaScript! &lt;/h1&gt;<br><br>&lt;!-- JavaScript code is written inside &lt;script&gt; tags --&gt;<br>&lt;script&gt; <br>  alert(&#39;Hello World!&#39;); <br>  <br>  // While console.log displays the message in the console, <br>  // alert shows it as a pop-up on your screen. <br><br>&lt;/script&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>4. Save the file and <strong>open it in your browser</strong> (just double-click the file).</p><p>5. You’ll see a <strong>pop-up</strong> message that says <strong>“Hello, JavaScript!”</strong></p><p>And just like that, you’ve written and executed your first JavaScript code!</p><h4>Step 4: What’s Next?</h4><p>Now that your environment is ready, it’s time to start learning <strong>core JavaScript concepts</strong> like:</p><ul><li><strong>Variables</strong> — Store and manage data.</li><li><strong>Data Types</strong> — Numbers, text, booleans, and many more.</li><li><strong>Operators</strong> — Perform calculations and comparisons.</li><li><strong>Functions</strong> — Write reusable blocks of code.</li><li><strong>Loops</strong> — Repeat tasks efficiently.</li><li><strong>Events</strong> — React to clicks, typing, and user actions.</li><li><strong>Error Handling </strong>— catch and manage errors</li></ul><p><strong>Your Coding Adventure Starts Here!</strong></p><p>Now that you’ve taken your first step into the world of JavaScript, the next part is all about <strong>practice</strong>. You don’t need to rush into complex concepts just yet — what’s important is to get comfortable with what you’ve learned so far and continue building your confidence.</p><p>Here’s the fun part: <strong>the more you code, the better you’ll get</strong>. As you keep experimenting and writing code, things will start to click. You’ll begin to understand how JavaScript interacts with HTML and CSS, and you’ll unlock new possibilities for building interactive websites.</p><p><strong>Don’t rush. Take your time with the basics!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e724e3b1bd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>