<?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 Saurabhhavaldar on Medium]]></title>
        <description><![CDATA[Stories by Saurabhhavaldar on Medium]]></description>
        <link>https://medium.com/@saurabhhavaldar25?source=rss-f8ef589ad605------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eJCwqBzfnlpQ3evl</url>
            <title>Stories by Saurabhhavaldar on Medium</title>
            <link>https://medium.com/@saurabhhavaldar25?source=rss-f8ef589ad605------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:09:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saurabhhavaldar25/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[Data Types in JavaScript]]></title>
            <link>https://medium.com/@saurabhhavaldar25/data-types-in-javascript-c877a14f85ef?source=rss-f8ef589ad605------2</link>
            <guid isPermaLink="false">https://medium.com/p/c877a14f85ef</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[easy-coding]]></category>
            <category><![CDATA[datatypes-in-javascript]]></category>
            <dc:creator><![CDATA[Saurabhhavaldar]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 15:02:05 GMT</pubDate>
            <atom:updated>2026-03-07T15:02:05.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6DuzguITZPmoU-_P7vyNQ.png" /></figure><p>I will try to make you understand all about the Data Types in JavaScript in very easy words. <br>In any programming language, we need data types — without them, we cannot store even a single value in a machine.<br>That’s why data types exist: they tell the computer <strong>what kind of data</strong> we are working with and <strong>how</strong> it should be handled.</p><h3>What Is a Data Type?</h3><p>When you want to store something in memory — like an <strong>age</strong>, a <strong>name</strong>, a <strong>boolean value</strong>, or even a <strong>collection of information</strong> — you need a data type.<br>A data type defines the <strong>nature of the data</strong> and how the JavaScript engine should process it.</p><h3>Types of Data in JavaScript</h3><p>JavaScript has two main categories of data types:</p><ol><li><strong>Primitive Data Types</strong></li><li><strong>Non-Primitive (Reference) Data Types</strong></li></ol><h3>Understanding Primitive and Non-Primitive</h3><p>Let’s clarify what these terms mean.</p><ul><li><strong>Primitive Data Types</strong> are the <strong>basic building blocks</strong> of data in JavaScript.<br>They represent simple values like numbers, strings, and booleans.<br>Primitive values are <strong>immutable</strong>, meaning you cannot change the actual value itself — you can only replace it with a new value.</li><li><strong>Non-Primitive Data Types</strong> (also called <strong>Reference Types</strong>) are <strong>complex structures</strong> like objects, arrays, and functions.<br>These can hold multiple values and are <strong>mutable</strong>, meaning you can change their contents over time.</li></ul><h3>In Simple Words</h3><p><strong>Primitive Data Types</strong> are simple, single values that cannot be changed directly. They include<br><strong>Number</strong>, <strong>String</strong>, <strong>Boolean</strong>, <strong>Null</strong>, <strong>Undefined</strong>, <strong>Symbol</strong>, and <strong>BigInt</strong>.<br>These represent basic pieces of information like numbers, text, or true/false values.</p><p><strong>Non-Primitive Data Types</strong>, also known as <strong>Reference Types</strong>, are more complex structures that can hold multiple values or collections of data.<br>They include <strong>Object</strong>, <strong>Array</strong>, <strong>Function</strong>, <strong>Date</strong>, <strong>Map</strong>, and <strong>Set</strong>.<br>These are used when you need to group related information together or represent more advanced data relationships.</p><h3>Quick Example</h3><pre>// Primitive<br>let age = 25;        // Number<br>let name = &quot;Alice&quot;;  // String<br>let isAdmin = true;  // Boolean</pre><pre>// Non-Primitive<br>let user = { name: &quot;Alice&quot;, age: 25 }; // Object<br>let numbers = [1, 2, 3, 4];       // Array</pre><h3>Key Difference</h3><ul><li><strong>Primitive:</strong> Stored by value — copying creates a new independent value.</li><li><strong>Non-Primitive:</strong> Stored by reference — copying creates a reference to the same data.</li></ul><p>Example:</p><pre>// Primitive<br>let a = 10;<br>let b = a;<br>b = 20;<br>console.log(a); // 10 (unchanged)</pre><pre>// Non-Primitive<br>let obj1 = { name: &quot;Alice&quot; };<br>let obj2 = obj1;<br>obj2.name = &quot;Bob&quot;;<br>console.log(obj1.name); // &quot;Bob&quot; (same reference)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c877a14f85ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference between var, let and const]]></title>
            <link>https://medium.com/@saurabhhavaldar25/difference-between-var-let-and-const-dfc1d1625353?source=rss-f8ef589ad605------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfc1d1625353</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript-hoisting]]></category>
            <category><![CDATA[fundamentals]]></category>
            <category><![CDATA[variables]]></category>
            <dc:creator><![CDATA[Saurabhhavaldar]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 17:14:45 GMT</pubDate>
            <atom:updated>2026-02-23T17:24:05.130Z</atom:updated>
            <content:encoded><![CDATA[<p>In Javascript, we have the 3 ways to declare variable</p><p>1. Using <strong>var</strong><br>2. Using <strong>let</strong><br>3. Using <strong>const</strong></p><p>The difference is that<br><strong>— var is a function scope</strong> meaning that you can access the variable anywhere inside the function, you<strong> can re-declare </strong>or<strong> re-initialize</strong> the variables <br><strong>Ex</strong> — function outer(){<br>if(true){<br>var x=1;<br>}<br>console.log(x) <br>}<br>Even though x was declared inside the if block, it’s still accessible outside it because var ignores block boundaries.</p><p>— <strong>let is a block scope</strong> meaning that you can access the variable only inside the curly braces i.e {} and not outside it. You can re-initialize the value but you can not re-declare it.</p><p>function outer() {<br> if (true) {<br> let x = 1;<br> console.log(x); // ✅ Accessible here<br> }<br> console.log(x); // ❌ ReferenceError: x is not defined<br>}<br>outer();</p><p>— <strong>const is also block scope </strong>meaning that you can access the variable only inside the curly braces i.e {} and not outside it. You can neither re-initialize the value of it nor you can re-declare it.</p><p>function outer() {<br> if (true) {<br> const x = 1;<br> console.log(x); // ✅ Accessible here<br> }<br> console.log(x); // ❌ ReferenceError: x is not defined<br>}<br>outer();</p><p><strong>Bonus:</strong><br>var is hoisted with the value undefined during the compilation phase, whereas let and const are also hoisted but remain in the <strong>Temporal Dead Zone (TDZ)</strong>.<br>This means you <strong>cannot access</strong> these variables before they are declared and assigned a value — doing so will result in a <strong>ReferenceError</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfc1d1625353" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript — Callback function]]></title>
            <link>https://medium.com/@saurabhhavaldar25/javascript-callback-function-21033d8c39e6?source=rss-f8ef589ad605------2</link>
            <guid isPermaLink="false">https://medium.com/p/21033d8c39e6</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[callback-function]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Saurabhhavaldar]]></dc:creator>
            <pubDate>Fri, 05 Sep 2025 14:08:42 GMT</pubDate>
            <atom:updated>2025-09-11T07:58:35.296Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>JavaScript — Callback function</strong></h3><p><strong>Hello Guys, Welcome to my blog!</strong><br> Today we are going to learn about <strong>Callback Functions in JavaScript</strong> at a very basic level.</p><p>If you’re just starting out with JavaScript, you might have already seen functions being passed into other functions. That’s what callbacks are all about! Don’t worry if it sounds confusing right now — we’ll break it down step by step with super simple examples so you can understand it easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ve5OhpyziW6KtwbGz7YBFQ.png" /></figure><p><strong>Callback function </strong>— A callback function is simply a function that is <strong>passed as an argument</strong> to another function and is <strong>executed later</strong> by that function.</p><p>Example:-</p><pre>function greetUser(name, callback) {<br>  console.log(&quot;Hello &quot; + name);<br>  callback();<br>}<br><br>function sayThanks() {<br>  console.log(&quot;Thanks for visiting!&quot;);<br>}<br><br>greetUser(&quot;Sourabh&quot;, sayThanks);</pre><p>Output:-</p><pre>Hello Sourabh<br>Thanks for visiting!</pre><h4>Explanation:-</h4><p>Here, the <strong>greetUser</strong> function is called first with two arguments:</p><ol><li>A string &quot;Sourabh&quot;</li><li>A callback function <strong>sayThanks</strong></li></ol><p>Inside the <strong>greetUser</strong> function, we are executing the function that we passed as an argument. That’s why <strong>sayThanks</strong> runs after printing the greeting.</p><p>⚡ That’s it for today’s blog!<br> Hope this helped you understand callbacks at a beginner-friendly level. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21033d8c39e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>