<?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>Forem: namitmalasi</title>
    <description>The latest articles on Forem by namitmalasi (@namitmalasi).</description>
    <link>https://forem.com/namitmalasi</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%2F483776%2F7b3763df-83ca-4afb-863f-eb57ea1f5406.jpg</url>
      <title>Forem: namitmalasi</title>
      <link>https://forem.com/namitmalasi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/namitmalasi"/>
    <language>en</language>
    <item>
      <title>When you type a URL in the browser!</title>
      <dc:creator>namitmalasi</dc:creator>
      <pubDate>Sun, 31 Oct 2021 07:57:26 +0000</pubDate>
      <link>https://forem.com/namitmalasi/when-you-type-a-url-in-the-browser-1cli</link>
      <guid>https://forem.com/namitmalasi/when-you-type-a-url-in-the-browser-1cli</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Have you ever wondered what exactly happens when you type an URL in the browser and press enter? In this blog, we will see what happens in the background, step by step when we type any URL.&lt;br&gt;
If you want to have a better understanding of this article,then i would recommend you to have an overview of &lt;a href="https://dev.to/namitmalasi/url-and-dns-explained-4aef"&gt;URL and DNS&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. You enter URL in the browser
&lt;/h3&gt;

&lt;p&gt;It basically means that you want to reach the server where the site is hosted. for example, if you are searching for facebook.com then, you are searching for the server where facebook .com is hosted.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The browser looks for the IP Address in the DNS(Domain name server)
&lt;/h3&gt;

&lt;p&gt;a) The browser maintains a cache of the DNS records for some fixed amount of time. So, it is the first place to run a DNS query.&lt;/p&gt;

&lt;p&gt;b) If the browser doesn't contain the cache then it requests to the Operating System as the OS also maintains a cache of the DNS records.&lt;/p&gt;

&lt;p&gt;c) If your computer doesn't have the cache, then it searches the routers as routers also have the cache of the DNS records.&lt;/p&gt;

&lt;p&gt;d) If all above steps fail, the browser would move on to the ISP. Your ISP maintains it's own DNS server which includes a cache of DNS records which the browser would check.&lt;/p&gt;

&lt;p&gt;If the requested URL is not in the cache, ISP’s DNS server initiates a DNS query to find the IP address of the server that hosts facebook.com.&lt;br&gt;
The purpose of a DNS query is to search multiple DNS servers on the internet until it finds the correct IP address for the website.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Browser initiates a TCP connection with the server.
&lt;/h3&gt;

&lt;p&gt;When the browser receives the IP address, it will build a connection between the browser and the server using the internet protocol. The most common protocol used is TCP protocol. The connection is established using a &lt;a href="https://www.guru99.com/tcp-3-way-handshake.html"&gt;three-way handshake&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The browser sends an HTTP request to the server.
&lt;/h3&gt;

&lt;p&gt;Once the TCP connection is established, it is time to start transferring data! The browser will send a GET request asking for facebook.com web page.&lt;/p&gt;

&lt;p&gt;Sample Get Request:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--msrVKp6p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://media-exp1.licdn.com/dms/image/C5112AQGhbJSc5YTomg/article-inline_image-shrink_1500_2232/0/1559318572982%3Fe%3D1641427200%26v%3Dbeta%26t%3Db0enUMgQMYHkuGUQD9iSppidf6-qb5Qo8bBw-cP1yFI" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--msrVKp6p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://media-exp1.licdn.com/dms/image/C5112AQGhbJSc5YTomg/article-inline_image-shrink_1500_2232/0/1559318572982%3Fe%3D1641427200%26v%3Dbeta%26t%3Db0enUMgQMYHkuGUQD9iSppidf6-qb5Qo8bBw-cP1yFI" alt="Sample Get Request" width="880" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The server handles the request and sends back a response.
&lt;/h3&gt;

&lt;p&gt;The server handles the HTTP request and sends a response. The server response contains the web page you requested as well as the status code, compression type (Content-Encoding), how to cache the page (Cache-Control), any cookies to set, privacy information, etc.&lt;/p&gt;

&lt;p&gt;Example HTTP server response:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3v0AA5CU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://media-exp1.licdn.com/dms/image/C5112AQGQs0X5LR4eoA/article-inline_image-shrink_1500_2232-alternative/0/1559318638805%3Fe%3D1641427200%26v%3Dbeta%26t%3Dn4GTWBBE_YQMp_MZHsNRejx2n-zEeCZtbC2K3ptyAcQ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3v0AA5CU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://media-exp1.licdn.com/dms/image/C5112AQGQs0X5LR4eoA/article-inline_image-shrink_1500_2232-alternative/0/1559318638805%3Fe%3D1641427200%26v%3Dbeta%26t%3Dn4GTWBBE_YQMp_MZHsNRejx2n-zEeCZtbC2K3ptyAcQ" alt="Example HTTP server response:" width="880" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. The browser displays the HTML content.
&lt;/h3&gt;

&lt;p&gt;The browser displays the HTML content in phases. First, it will render the bare bone HTML skeleton. Then it will check the HTML tags and sends out GET requests for additional elements on the web page, such as images, CSS stylesheets, JavaScript files etc.&lt;br&gt;
At the end, you’ll see facebook.com appearing on your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I really hope that you enjoyed reading this article and learned something from it. If you have any doubt or you think i missed something let me know in the comments.&lt;br&gt;
You can connect with me on:&lt;/p&gt;

&lt;p&gt;Twitter:&lt;a href="https://twitter.com/namitmalasi"&gt;Namit Malasi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>browser</category>
      <category>url</category>
    </item>
    <item>
      <title>URL and DNS explained!</title>
      <dc:creator>namitmalasi</dc:creator>
      <pubDate>Sun, 10 Oct 2021 15:37:00 +0000</pubDate>
      <link>https://forem.com/namitmalasi/url-and-dns-explained-4aef</link>
      <guid>https://forem.com/namitmalasi/url-and-dns-explained-4aef</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Whenever you search for any resource(website, docs, images etc) on the internet, you can see their address in the address bar. This address tells us that the particular resource is hosted on that address server. The address is called URL and searching the server is done using DNS.&lt;/p&gt;

&lt;p&gt;So in this article we are going to learn about &lt;em&gt;URL&lt;/em&gt; and &lt;em&gt;DNS&lt;/em&gt;. This article is an overview and i haven't got into too much details.&lt;/p&gt;

&lt;h2&gt;
  
  
  1) &lt;u&gt;URL&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt; stands for Uniform Resource Locator. URL is the address of the website which you can find in the address bar of your web browser. It is a reference to a resource on the internet, be it images, hypertext pages, audio/video files, etc.&lt;br&gt;
For example: &lt;code&gt;https://www.google.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There are different parts of a URL, they are shown in the image below&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fexternal-content.duckduckgo.com%2Fiu%2F%3Fu%3Dhttps%253A%252F%252Flh4.googleusercontent.com%252F-Lx69aIsa078%252FTXuNzpIGRbI%252FAAAAAAAAACw%252F95JWAs_yYsw%252Fs1600%252FURL.png%26f%3D1%26nofb%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fexternal-content.duckduckgo.com%2Fiu%2F%3Fu%3Dhttps%253A%252F%252Flh4.googleusercontent.com%252F-Lx69aIsa078%252FTXuNzpIGRbI%252FAAAAAAAAACw%252F95JWAs_yYsw%252Fs1600%252FURL.png%26f%3D1%26nofb%3D1" alt="Alt text of image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  a) Scheme
&lt;/h3&gt;

&lt;p&gt;The first part of the URL is the scheme, which indicates the protocol that the browser must use to request the resource (a protocol is a set method for exchanging or transferring data around a computer network). Usually for websites the protocol is HTTPS or HTTP (its unsecured version). &lt;/p&gt;

&lt;h3&gt;
  
  
  b) WWW(Sub-domain)
&lt;/h3&gt;

&lt;p&gt;After protocol comes the famous WWW, it simply means that the resource you are seeking by the means of this URL resides in the WWW subdomain of your domain name.&lt;/p&gt;

&lt;h3&gt;
  
  
  c) Domain name
&lt;/h3&gt;

&lt;p&gt;Then the name of the resource owner (i.e. domain name) comes which is google in our example.&lt;/p&gt;

&lt;h3&gt;
  
  
  d) Top-level domain
&lt;/h3&gt;

&lt;p&gt;Domain name is followed by the type of category in which the owner domain is registered. &lt;em&gt;.com&lt;/em&gt; means that the website which is making this resource available to you is of the commercial nature. There are a lot of other types of categories as well. For example, .org for organizational website, .edu for educational institutions, .gov for government websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  e) File Path
&lt;/h3&gt;

&lt;p&gt;The path refers to the exact location of a page, post, file, or other asset. The path resides after the hostname and is separated by “/” (forward slash). The path/file also consists of any asset file extension, such as images (.jpg or .png, etc.), documents (.pdf or .docx), and more. &lt;br&gt;
But it is not compulsory that all URL will display the path.&lt;/p&gt;

&lt;h2&gt;
  
  
  2) &lt;u&gt;DNS&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DNS&lt;/strong&gt; is short for Domain Name System. Like a phone-book, DNS maintains and maps the name of the website, i.e. URL, and particular IP address it links to. Every URL on the internet has a unique IP address which is of the computer which hosts the server of the website requested.&lt;/p&gt;

&lt;h3&gt;
  
  
  How DNS works?
&lt;/h3&gt;

&lt;p&gt;When you type a URL in the browser, the following steps take place:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The browser checks for a DNS record to find the corresponding IP address of the website.&lt;/li&gt;
&lt;li&gt;Once the browser receives the correct IP address, it will build  a connection with the server that matches the IP address to transfer information.&lt;/li&gt;
&lt;li&gt;The browser sends an HTTP request to the server.&lt;/li&gt;
&lt;li&gt;The server handles the request and sends back a response.&lt;/li&gt;
&lt;li&gt;The browser displays the HTML content.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I really hope that you enjoyed reading this article and learned something from it. If you have any doubt or you think i missed something let me know in the comments. Feel free to like and share the post. &lt;br&gt;
You can connect with me on:&lt;/p&gt;

&lt;p&gt;Twitter:&lt;a href="https://twitter.com/namitmalasi" rel="noopener noreferrer"&gt;Namit Malasi&lt;/a&gt;&lt;br&gt;
LinkedIn:&lt;a href="https://www.linkedin.com/in/namit-malasi-a4b56310a/" rel="noopener noreferrer"&gt;Namit Malasi&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/namitmalasi" rel="noopener noreferrer"&gt;Namit Malasi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>url</category>
      <category>browser</category>
    </item>
    <item>
      <title>Map, Filter and Reduce explained.</title>
      <dc:creator>namitmalasi</dc:creator>
      <pubDate>Sun, 12 Sep 2021 13:37:20 +0000</pubDate>
      <link>https://forem.com/namitmalasi/map-filter-and-reduce-explained-19np</link>
      <guid>https://forem.com/namitmalasi/map-filter-and-reduce-explained-19np</guid>
      <description>&lt;p&gt;You probably have heard of .map(), .reduce() and .filter(). &lt;br&gt;
Map, reduce, and filter are all array methods in JavaScript.In this article, you will learn why and how to use each one. &lt;br&gt;
I will try and explain with examples of how each of these functions works.&lt;/p&gt;
&lt;h3&gt;
  
  
  map()
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;map()&lt;/strong&gt; is used to transform an array. It creates a new array populated with the results of the calling function on every element in the calling array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array=[1,2,3,4,5];

const output=array.map(element=&amp;gt;
 {
  return element*2;
})

console.log(output);  // [2,4,6,8,10]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code,&lt;br&gt;
array ===calling array&lt;br&gt;
element=&amp;gt;{...} ===calling function&lt;/p&gt;

&lt;p&gt;The array elements are being traversed one by one and in each iteration the current element is multiplied by 2. The new value is pushed into a new array and after the traversal is complete we get a new array of elements in the output.&lt;/p&gt;
&lt;h3&gt;
  
  
  filter()
&lt;/h3&gt;

&lt;p&gt;Filter is used to filter the array. &lt;strong&gt;filter()&lt;/strong&gt; method creates a new array with all the elements that pass the test implemented by the provided function.&lt;br&gt;
If the test condition returns true, the element gets pushed to the output array. If the condition returns false, the element does not get pushed to the output array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array=[10,23,55,40,111];

const output=array.filter(element=&amp;gt;
                      {
  return element%2;
})

console.log(output);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above it is filtering out all the odd elements from the array based on the test implemented in the function and pushing them into a new array and then returning the new array.&lt;/p&gt;

&lt;h3&gt;
  
  
  reduce()
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;reduce()&lt;/strong&gt; method executes a reducer function on each element of the array, resulting in a single output value.&lt;br&gt;
The reducer function takes two-parameter (accumulator, current).&lt;/p&gt;

&lt;p&gt;accumulator= the returned value of the previous iteration&lt;br&gt;
current=the current item in 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;const array=[1,2,3,4,5,6,7,8,9];

const output=array.reduce((acc,curr)=&amp;gt;
{
acc=acc+curr
 return acc

},0)

console.log(output);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code calculates the sum of the elements of the array.&lt;br&gt;
The initial value of acc is set to 0 as mentioned in the code. On each iteration, the current element is added to acc, and hence at last the total sum is returned.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;I really hope that you enjoyed reading this article and learned something from it. If you have any doubt or you think i missed something let me know in the comments. Feel free to like and share the post. &lt;br&gt;
You can connect with me on:&lt;br&gt;
Twitter:&lt;a href="https://twitter.com/namitmalasi"&gt;Namit Malasi&lt;/a&gt;&lt;br&gt;
LinkedIn:&lt;a href="https://www.linkedin.com/in/namit-malasi-a4b56310a/"&gt;Namit Malasi&lt;/a&gt;&lt;br&gt;
Github: &lt;a href="https://github.com/namitmalasi"&gt;Namit Malasi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>functional</category>
    </item>
    <item>
      <title>How javascript code is executed</title>
      <dc:creator>namitmalasi</dc:creator>
      <pubDate>Sat, 30 Jan 2021 16:24:39 +0000</pubDate>
      <link>https://forem.com/namitmalasi/how-javascript-code-is-executed-5km</link>
      <guid>https://forem.com/namitmalasi/how-javascript-code-is-executed-5km</guid>
      <description>&lt;p&gt;Everything in JavaScript happens inside an "&lt;strong&gt;Execution Context&lt;/strong&gt;”. Whenever a JavaScript program is run an execution context is created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;//line1 &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//line2&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;               &lt;span class="c1"&gt;//line3&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//line4&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;//line5&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;result1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//line6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when we run the above code, a &lt;strong&gt;global execution context (GEC)&lt;/strong&gt; is created. It is created in two phases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1)Creation Phase or Memory Creation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this phase, javascript allocates the memory to all the variables and functions present in the program. The variables are stored with the value &lt;em&gt;undefined&lt;/em&gt; and the function is stored with all the code present in that particular function. For the above code, the variable number is stored with the value &lt;em&gt;undefined&lt;/em&gt; and the function add is stored with value b/w the {...} curly braces. The result1 is also a variable so it is stored with the value &lt;em&gt;undefined&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2)Code Execution Phase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this phase the main execution takes place and the javascript runs through the code line by line. Now the &lt;em&gt;number&lt;/em&gt; value is changed from &lt;em&gt;undefined&lt;/em&gt; to &lt;em&gt;10&lt;/em&gt;. Then it moves to the next line as there is nothing to execute it moves to line 5. In line 5 function invocation takes place. When a new function is invoked a new execution context is created within the GEC.&lt;/p&gt;

&lt;p&gt;Now the again above process is repeated with the two phases but for only the add function. After the function is executed completely, the execution context created for that particular function will get deleted automatically.&lt;/p&gt;

&lt;p&gt;Now, when the whole javascript program is executed completely the GEC will also get deleted. &lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Call stack&lt;/strong&gt; is also maintained by javascript. Call stack maintains the &lt;strong&gt;"Order of execution of execution contexts"&lt;/strong&gt;. It works similarly as a stack whenever a new function invoked its execution context is pushed into the call stack.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F836mfeh1nyfu7j2me73b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F836mfeh1nyfu7j2me73b.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The GEC is at the bottom of the call stack as it is created at the starting of the program and all the new execution context is pushed on top of it. So when a function's execution gets finished its execution context is also removed from the call stack.&lt;/p&gt;

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

&lt;p&gt;I hope you would have found this article beneficial.&lt;br&gt;
Thank you for reading through this article.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>How Javascript Works!!!</title>
      <dc:creator>namitmalasi</dc:creator>
      <pubDate>Fri, 04 Dec 2020 15:54:03 +0000</pubDate>
      <link>https://forem.com/namitmalasi/how-javascript-works-3nan</link>
      <guid>https://forem.com/namitmalasi/how-javascript-works-3nan</guid>
      <description>&lt;p&gt;"Javascript is a &lt;strong&gt;synchronous single-threaded&lt;/strong&gt; language". JS is single-threaded which means only one statement is executed at a time. Synchronous execution usually refers to code executing in sequence. In sync programming, the program is executed line by line, one line at a time. &lt;/p&gt;

&lt;p&gt;Everything in JavaScript happens inside an "&lt;strong&gt;Execution Context&lt;/strong&gt;”. Execution Context can be assumed as a container or a body where JavaScript code is executed.&lt;/p&gt;

&lt;p&gt;Execution Context has two components:&lt;br&gt;
&lt;strong&gt;a) Variable Environment (a.k.a Memory)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All the variables and functions are stored in Variable environment in the form of &lt;strong&gt;key-value&lt;/strong&gt; pairs. For example,&lt;/p&gt;

&lt;p&gt;var firstVariable = 100;      //line 1&lt;br&gt;
function test() {             //line 2&lt;br&gt;
  var secondVariable = 200;   //line 3&lt;br&gt;
  console.log(firstVariable + " " + secondVariable);    //line 4&lt;br&gt;
}&lt;br&gt;
test();&lt;/p&gt;

&lt;p&gt;In the above code snippet, the variables firstVariable and secondVariable will be stored with their values and the function test will be stored with all its code as it is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b) Thread of Execution (a.k.a Code)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the Thread of execution, the JavaScript code is executed line by line.&lt;/p&gt;

&lt;p&gt;var firstVariable = 100;      //line 1&lt;br&gt;
function test() {             //line 2&lt;br&gt;
  var secondVariable = 200;   //line 3&lt;br&gt;
  console.log(firstVariable + " " + secondVariable);    //line 4&lt;br&gt;
}&lt;br&gt;
test();&lt;br&gt;
The above code will be executed line by line from line 1 to line 4.&lt;/p&gt;

&lt;p&gt;This was just an overview of how javascript works behind the scenes. I hope you would have found this article beneficial.&lt;br&gt;
Thank you for reading through this article.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Hactoberfest 2020 Badge </title>
      <dc:creator>namitmalasi</dc:creator>
      <pubDate>Fri, 04 Dec 2020 06:19:02 +0000</pubDate>
      <link>https://forem.com/namitmalasi/hactoberfest-2020-badge-4fl4</link>
      <guid>https://forem.com/namitmalasi/hactoberfest-2020-badge-4fl4</guid>
      <description>&lt;p&gt;Happy to share that I have received my hacktoberfest 2020 Challenge Badge. This is my first ever hacktoberfest participation, and it was really helpful for me to explore and contribute to open source projects.&lt;/p&gt;

&lt;p&gt;Hacktoberfest is really great platform, contributing to open source projects is a great way to improve your skills, gain confidence, and practice coding.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
  </channel>
</rss>
