<?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 Bitopan Deka on Medium]]></title>
        <description><![CDATA[Stories by Bitopan Deka on Medium]]></description>
        <link>https://medium.com/@bitopanxon1?source=rss-e0e84722bc15------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gcfI3u-mhP8s6ZMO</url>
            <title>Stories by Bitopan Deka on Medium</title>
            <link>https://medium.com/@bitopanxon1?source=rss-e0e84722bc15------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:07:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bitopanxon1/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[Primitive vs Non-Primitive data type in JavaScript]]></title>
            <link>https://bitopanxon1.medium.com/primitive-vs-non-primitive-data-type-in-javascript-fad8d9734be7?source=rss-e0e84722bc15------2</link>
            <guid isPermaLink="false">https://medium.com/p/fad8d9734be7</guid>
            <category><![CDATA[writing-tips]]></category>
            <category><![CDATA[freelancing]]></category>
            <category><![CDATA[writer]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[freelancers]]></category>
            <dc:creator><![CDATA[Bitopan Deka]]></dc:creator>
            <pubDate>Thu, 03 Mar 2022 11:39:26 GMT</pubDate>
            <atom:updated>2022-03-03T11:39:26.517Z</atom:updated>
            <content:encoded><![CDATA[<p>Primitive data types in JavaScript are : <br><strong>number, string, boolean, null, undefined, symbol</strong> (new in ECMAScript 2015)<br>Whereas <strong>undefined</strong> and <strong>null</strong> are considered as <strong>special data types </strong>in JavaScript</p><p>Non-Primitive data types in JavaScript are</p><p><strong>array, object, function, date, regex, …</strong></p><p>Now let’s see the differences between Primitive vs Non-Primitive data types in JavaScript with an example deeply :<br>1. Primitive datatype gets the fixed amount of memory at compile time. This technique is called <strong>Static Memory Allocation</strong>. It is stored in <strong>STACK memory</strong> so it is <strong>fast </strong>and known as being an <strong>immutable data type</strong> means we cannot change or increase its content after it is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*8IG-SAEqmuEuaAbznOWimA.png" /></figure><p>In the above example we cannot modify the content of <strong>name</strong> because it has fixed size of memory and that has allocated at the compile time.</p><p>Non — primitive follows the technique of <strong>Dynamic Memory Allocation</strong> where memory allocation is not fixed and it depends on the content. It is stored in <strong>HEAP memory</strong> so it is <strong>slow</strong> compare to primitive datatype and known as being <strong>mutable data types</strong> means we can change or increase its content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*FF524s8l-Hzcy63n1PsuLQ.png" /></figure><p>In the above example we can modify the content of <strong>arr</strong> because it has no fixed size of memory.<br>2. — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>In primitive data type as memory allocation is fixed so we cannot store large data whereas in non-primitive data type we can do that. Which is why Non primitive data type is used mostly in real application like storing customer details, billing details, order details etc.</p><p>3. — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Now let’s understand one more important difference with an example as below</p><p>Let’s consider a primitive data type like <strong>string</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*3tpEAm-9yU8edTDWsS6COw.png" /></figure><p>In the above example we can see that even though we have changed the <strong>name</strong> variable with ‘<strong>John’</strong> still the previous one ‘<strong>Gourab’</strong> is reflecting. It should print ‘<strong>John’</strong> right? Now why it is not happening? Let’s understand the concept now deeply.</p><p>In memory we have a no of block having some address. The smallest block can store only single bit (i.e. 0 or 1). Now based on the data type size it contains that many no of blocks.</p><p>The variable like <strong>name</strong> here is basically a block that consists of a no of single bit blocks based on its data type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*w7bZixmsUfiEj7yUpgILYQ.png" /></figure><p>While using primitive data type to store a value in a variable, that variable contains copy of that value. Here it is ‘<strong>Gourab’</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*wfG4dGAAoGqt9zepU2S0OA.png" /></figure><p>After assigning <strong>name</strong> into new variable <strong>firstName</strong>, a new variable is created and which stores a copy of value of <strong>name</strong> variable that is ‘<strong>Gourab’</strong>. So, it prints ‘<strong>Gourab’</strong>.</p><p>Now we changed the value of <strong>name</strong> variable. So, again it stores a copy of value <strong>John</strong> and it will override the previous value ‘<strong>Gourab’</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*XlIIqJ2doWxIyHT9Jwd_BQ.png" /></figure><p>But is there any changes happened in value of <strong>firstName</strong> variable?</p><p>No, because it is storing a copy not the address or reference of <strong>name</strong> variable. Hence copy will not be changed though we are changing in the original one.</p><p><strong>In conclusion using primitive values are copy by value.</strong></p><p>Let’s consider a Non primitive data type like <strong>object</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*GmT_jF3fg7Ls9SWhVKz9eQ.png" /></figure><p>Here object {name: ‘Gourab’, age: 24} is stored in memory address say 2000. Now person variable here is non primitive so it is not storing copy of value but it is storing the reference or memory address i.e. 2000. So, we can say person variable is pointing to the object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*nWCg2NYLrHap1YsMFBaWVw.png" /></figure><p>Now while assigning person value into <strong>secondPerson</strong> variable it is also storing the reference of the object i.e. <strong>2000</strong> not the copy of its value. So, we can say <strong>secondPerson</strong> also now <strong>pointing to the same object</strong>. So, it prints ‘<strong>Gourab’</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*msVgFXb5bnKFQudRKeggXg.png" /></figure><p>As person is storing the reference so through, we are changing the name i.e. we are changing the actual object and as secondPerson is also pointing to that object so, that changes also will be reflected when we try to access that object using secondPerson.</p><p><strong>In conclusion Non — Primitive values are reference by value.</strong></p><p>These are the main differences between Primitive and Non- primitive data types in JavaScript.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fad8d9734be7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implicit type coercion in comparison (JavaScript)]]></title>
            <link>https://bitopanxon1.medium.com/implicit-type-coercion-in-comparison-javascript-ab4d2dafc0f4?source=rss-e0e84722bc15------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab4d2dafc0f4</guid>
            <dc:creator><![CDATA[Bitopan Deka]]></dc:creator>
            <pubDate>Sat, 08 May 2021 22:23:11 GMT</pubDate>
            <atom:updated>2021-05-08T22:23:11.036Z</atom:updated>
            <content:encoded><![CDATA[<p>When it’s come to <strong>JavaScript</strong> we have many comparison operators. When we compare different types of data some operators behave differently. This behavior is called implicit type coercion. In brief <em>implicit type </em>coercion is a conversion which is done by JavaScript. So when we compare two different data type together then JavaScript converts the values to a same data type. In JavaScript, implicit type coercion does not happen in case of <strong>equal value and equal type </strong>(===) operator and <strong>not equal value or not equal type </strong>(!==) operator that’s why we will talk about other comparison operators where implicit type coercion exist.</p><ul><li>Greater than (&gt;)</li><li>Less than (&lt;)</li><li>Greater than or equal (&gt;=)</li><li>Less than or equal (&lt;=)</li><li>Double equal (==)</li><li>not equal (!=)</li></ul><p>So when the implicit type coercion happens in comparison, the values are always converted to `number` data type. Let’s see some examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*CNPQdoIglll_FKwd57gedA.png" /></figure><p>In the first example, boolean <strong><em>true</em></strong> has converted into number <strong><em>1</em></strong>. In the second example string <strong><em>“13”</em></strong> has converted into <strong><em>13</em></strong> and in the third example, <strong><em>false </em></strong>became <strong><em>0 </em></strong>and string <strong><em>“”</em></strong> became number <strong><em>0</em></strong>. In the fourth example, <strong><em>true </em></strong>converted into number <strong><em>1 </em></strong>and string <strong><em>“13” </em></strong>has converted into number <strong><em>13</em></strong>. Let’s see a string with another data type values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*YSTx_I_DZtlWt_XVIYbyAA.png" /></figure><p>In the first example <strong><em>“”</em></strong> get converted into number <strong><em>0</em></strong>, that’s why got false. In the second example, boolean <strong><em>false </em></strong>get converted into number 0 and you must be thinking that string <strong><em>“hello”</em></strong> should be converted into number <strong><em>1</em></strong>. But here the string “hello” gets converted into <strong><em>NaN </em></strong>(Not a Number). So when we compare any value with <strong><em>NaN </em></strong>the result will always be <strong><em>false</em></strong> because <strong><em>NaN </em></strong>is not equal to any value even itself. That’s why if we write <strong><em>NaN == NaN</em></strong> we will get <strong><em>false</em></strong>. Let’s understand this in a simple way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*hBC8eNgwDmbrCVKbYmx4jQ.png" /></figure><p>In the first line, we have converted <strong><em>“hello” </em></strong>into a number and we get <strong><em>NaN </em></strong>and in the second line we have converted <strong><em>“hell”</em></strong> into a number and we get <strong><em>NaN</em></strong>. So <strong><em>“hello”</em></strong> and <strong><em>“hell” </em></strong>can’t be equal that’s why <strong><em>NaN </em></strong>can’t be equal to <strong><em>NaN</em></strong>. Now let’s look at <strong><em>undefined </em></strong>and <strong><em>null</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*TTV_Mi_fYrenIwJT47jVOQ.png" /></figure><p>In the first example, <strong><em>undefined </em></strong>get converted into <strong><em>NaN </em></strong>and we know when we compare any value with <strong><em>NaN </em></strong>we always get false. In the second line, <strong><em>null </em></strong>gets converted into <strong><em>0 </em></strong>so <strong><em>0 </em></strong>can’t be greater than itself. Now let’s look at the third example we are getting true because <strong><em>null </em></strong>get converted into <strong><em>0</em></strong>. But we didn’t get true in the fourth example because double equal works differently in case of falsy value. JavaScript has 6 falsy value. Let’s understand how <strong><em>double equal</em></strong>(==) operator works in case of <em>falsy</em> value through a diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*nF5Ek-9Gh2LeTeLlRco-Qw.png" /></figure><p>In the above diagram, values of each box can interact with each other but not with the other boxes i.e. <strong><em>0</em></strong>, <strong><em>“”</em></strong> and <strong><em>false </em></strong>can’t be equal to <strong><em>null</em></strong>, <strong><em>undefined </em></strong>and <strong><em>NaN</em></strong>. Similarly <strong><em>null </em></strong>and <strong><em>undefined </em></strong>can’t be equal with <strong><em>NaN</em></strong>, <strong><em>0</em></strong>, <strong><em>“”</em></strong> and <strong><em>false</em></strong>. But <strong><em>0</em></strong>, <strong><em>“”</em></strong> and <strong><em>false </em></strong>are equal to each other similarly <strong><em>undefined </em></strong>and <strong><em>null </em></strong>is equal with each other.</p><h3>Summary</h3><p>In JavaScript, we have different types of comparison operator. When we compare different data types then it behaves differently. In different data type comparison, implicit type coercion always converts the data to a number data type. <strong><em>NaN </em></strong>can’t be equal to itself. In the case of double equal operator <strong><em>0</em></strong>, <strong><em>“” </em></strong>and <strong><em>false </em></strong>can’t be equal to <strong><em>null</em></strong>, <strong><em>undefined </em></strong>and <strong><em>NaN</em></strong>. Similarly <strong><em>null </em></strong>and <strong><em>undefined</em></strong> can’t be equal with <strong><em>NaN</em></strong>, <strong><em>0</em></strong>, <strong><em>“”</em></strong> and <strong><em>false</em></strong>. But <strong><em>0</em></strong>, <strong><em>“”</em></strong> and <strong><em>false </em></strong>are equal to each other similarly <strong><em>undefined </em></strong>and <strong><em>null </em></strong>is equal with each other.</p><p>Twitter : <a href="https://medium.com/u/e0e84722bc15">Bitopan Deka</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab4d2dafc0f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git and GitHub]]></title>
            <link>https://bitopanxon1.medium.com/git-and-github-89b4fa683a2b?source=rss-e0e84722bc15------2</link>
            <guid isPermaLink="false">https://medium.com/p/89b4fa683a2b</guid>
            <category><![CDATA[altcampus]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Bitopan Deka]]></dc:creator>
            <pubDate>Sat, 13 Feb 2021 22:34:09 GMT</pubDate>
            <atom:updated>2021-03-10T13:19:29.289Z</atom:updated>
            <content:encoded><![CDATA[<h3>▪ What are Git and GitHub?</h3><p>Git and GitHub are not the same things. Git is an open-source, version control tool created in 2005 by developers working on the Linux operating system; GitHub is a company founded in 2008 that makes tools that integrate with git. You do not need GitHub to use git, but you cannot use GitHub without using git.</p><p>Simply, Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories. If you have open-source projects that use Git, then GitHub is designed to help you better manage them.</p><h3>▪ Create a local git repository</h3><p>While creating a new project on your local machine using git, you’ll first create a new repository. To use git we’ll be using the terminal. To begin, open up a terminal and move to where you want to place the project on your local machine using the cd (change directory) command. For example, if you have an ‘AltCampus’ folder on your desktop, you’d do something like:</p><pre>mkdir AltCampus</pre><h3>▪ How to add a new file to the repo?</h3><p>To add a new file to the project, we use `touch` command. `touch newfile.txt` just creates and saves a blank file named newfile.txt.</p><pre>touch newfile.txt</pre><p>Now, you can use the “git status” command to see which files git knows to exist.</p><pre>bitopan:AltCampus bitopan$ git status<br>On branch master<br><br>Initial commit<br><br>Untracked files:<br>  (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)<br><br>	bitopan.txt<br><br>nothing added to commit but untracked files present (use &quot;git add&quot; to track)</pre><p>“Now, we noticed you created a new file called bitopan.txt, but unless you use the ‘git add’ command we aren’t going to do anything with it.”</p><h3>▪ Initializing a new Git repo</h3><p>To initialize a git repository in the root of the folder, run the `git init` command:</p><pre>bitopan:AltCampus bitopan$ git init</pre><h3>▪ Add a file to the staging environment?</h3><p>By using the git add command we can add a file to the staging environment.</p><p>You can provide one or multiple paths and thereby add changes in these files to the Staging Area:</p><pre>git add index.html bitopan.txt</pre><p>when all current modifications in your project to be added to the Staging Area (including deletions and new files), you can simply use `— all `or `-A`:</p><pre>git add --all</pre><h3>▪ Create a commit?</h3><p>Commits are the building blocks of “save points” within Git’s version control.</p><pre>git commit -m &quot;descriptive commit message&quot;</pre><p>This starts the commit process and allows you to include the commit message at the same time.</p><h3>▪ Create a new branch?</h3><p>The common way is by using the `branch` command directly (which checkout does behind the scenes):</p><pre> git branch &lt;branch-name&gt;</pre><p>The best way to create a new branch is the following:</p><pre>git checkout -b &lt;branch-name&gt;</pre><p>It will create the branch for you from your current branch and it will switch you to that branch in a single command.</p><h3>▪ There are four network commands :</h3><h4>git clone</h4><h4>git fetch</h4><h4>git pull</h4><h4>git push</h4><h3>▪ Git Clone</h3><p>When you create a repository on GitHub , it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.</p><p>`git clone` is used to create a copy or clone of remote repositories.</p><pre>git clone &lt;repo url&gt;</pre><h3>▪ Git Fetch</h3><p>The `git fetch` command downloads commit files, and refs from a remote repository into your local repo.No changes are actually reflected on any of the local working branches.</p><pre>git fetch &lt;remote&gt;</pre><h3>▪ Git Push</h3><p>The git push command takes two arguments:</p><ul><li>A remote name, for example, origin</li><li>A branch name, for example, main</li></ul><pre>git push <em> &lt;remote name&gt; &lt;branch name&gt;</em></pre><p>For example,</p><pre>git push origin main</pre><h3>▪ Git Pull</h3><p>`git pull ` is a combination of `git fetch` and git merge`.git fetch`updates remote-tracking branches. `git merge` updates the current branch with the corresponding remote-tracking branch. Using `git pull`, you get both parts of these updates.</p><pre>- General format<br>git pull OPTIONS REPOSITORY REFSPEC</pre><pre>- Pull from specific branch<br>git pull REMOTE-NAME BRANCH-NAME</pre><ul><li>OPTION — the command options.</li><li>REPOSITORY — URL to your repo.</li><li>REFSPEC — specifies which refs to fetch and which local refs to update</li><li>REMOTE-NAME — the name of your remote repository.</li><li>BRANCH -NAME -is the name of your branch.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89b4fa683a2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>