<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chisom🦄</title>
    <description>The latest articles on DEV Community by Chisom🦄 (@chisom_kanu01).</description>
    <link>https://dev.to/chisom_kanu01</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%2F932658%2F99bb9e27-9b2d-4962-9a04-5ba58d3bf313.jpg</url>
      <title>DEV Community: Chisom🦄</title>
      <link>https://dev.to/chisom_kanu01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chisom_kanu01"/>
    <language>en</language>
    <item>
      <title>Understanding CSS Positioning</title>
      <dc:creator>Chisom🦄</dc:creator>
      <pubDate>Thu, 29 Sep 2022 15:41:31 +0000</pubDate>
      <link>https://dev.to/chisom_kanu01/using-css-positioning-1cd3</link>
      <guid>https://dev.to/chisom_kanu01/using-css-positioning-1cd3</guid>
      <description>&lt;p&gt;The CSS position property is one of those things that has been around for quite sometime, it is necessary to learn if you are goin to be working on the web. CSS allows us use different methods to position elements. This article will give us a better understanding on CSS positioning, in this article we will learn about the various of the CSS position property and how to move elements based on its top, bottom ,right, and left positions, any CSS unit of measurement can work (em, px, etc). You need to understand HTML and the basics of CSS.&lt;/p&gt;

&lt;p&gt;What is CSS position property?&lt;br&gt;
 The CSS position property is used to position an element in a document, it allows us to define where element boxes are going to be on the web page. The CSS position property is used to position an element in a document, it allows us to define where element boxes are going to be on the web page relative to their usual starting position or relative to their parent elements.&lt;/p&gt;

&lt;p&gt;The five main values the position property can take are;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static positioning&lt;/li&gt;
&lt;li&gt;Relative positioning&lt;/li&gt;
&lt;li&gt;Absolute positioning&lt;/li&gt;
&lt;li&gt;Fixed positioning&lt;/li&gt;
&lt;li&gt;Sticky positioning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's discus,&lt;/p&gt;

&lt;p&gt;Static positioning&lt;/p&gt;

&lt;p&gt;Position:static is the automatically applied property, static elements cannot be moved, it means that the element follows the normal document flow. They are not affected by the top, bottom, right and left properties. It is the default positioning&lt;br&gt;
value.&lt;/p&gt;

&lt;p&gt;Let's use an example to illustrate;&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;‹div class="parents"&amp;gt;
    ‹div class="divs"&amp;gt;
    &amp;lt;div class="One"&amp;gt;Div One&amp;lt;/div&amp;gt;
    ‹div class="Two"&amp;gt;Div Two&amp;lt;/div&amp;gt;
    &amp;lt;div class="Three &amp;gt;Div Three&amp;lt;/div&amp;gt;
    ‹div class="four ›Div Four&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

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

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; div.two{
     position:static;
     top:50px;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result.&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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664295593414_file.jpeg" 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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664295593414_file.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will notice there is no change, which confirms that the top, bottom, left and right properties do not affect an element in position static.&lt;/p&gt;

&lt;p&gt;Relative Positioning&lt;br&gt;
It takes the element from the original position and moves it to any position you want it to be, it lets you change an elements position, to change the position you need to apply the top, bottom, right, and left properties and specify where you want to move the element. Elements are not removed from the normal document flow, It is positioned according to it's original position.&lt;/p&gt;

&lt;p&gt;Example.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;div class=”box”&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

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

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box{
     width: 400px;
     height: 400px;
     border: 5px solid black;
     margin:20px auto;
    }
    .item1,.item2{
     width: 150px;
     height: 150px;
    }

    .item1{
      background-color: #508AA8;
      position: relative;
      left: 20px;
    }
    .item2{
      background-color: #6F1A07;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result.&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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664296951611_file.jpeg" 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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664296951611_file.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In relative positioning nothing happens until we use one of the offset properties(top, bottom, left and right) to offset it.&lt;/p&gt;

&lt;p&gt;The Positive values move the element away from the name side but negative values move the element to the name direction.&lt;/p&gt;

&lt;p&gt;Absolute positioning&lt;br&gt;
In this position the elements are removed from the normal document flow. It is not positioned according to elements original position, absolute positioning are positioned differently from relative elements, they are positioned according to the nearest containing elements, the containing element or the nearest parent element that has a position. Their is always a parent element that comes into play with absolute positioning. It's final position is determined by the top, bottom, right, and left values.&lt;/p&gt;

&lt;p&gt;For example;&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class=”box”&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
    reprehenderit in voluptate velit esse cillum dolore eu
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
    anim id est laborum.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box{
     width: 400px;
     height: 400px;
     border: 5px solid black;
     margin:20px auto;
    }
    .item1,.item2{
     width: 150px;
     height: 150px;
    }

    .item1{
      background-color: #508AA8;
      position: absolute;
      bottom:0px;
    }
    .item2{
      background-color: #6F1A07;
    }

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

&lt;/div&gt;



&lt;p&gt;The result.&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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664298005144_file.jpeg" 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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664298005144_file.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want this position relative to the box all you have to do is add position:relative to our box.&lt;/p&gt;

&lt;p&gt;For example.&lt;br&gt;
HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;div class=”box”&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
    reprehenderit in voluptate velit esse cillum dolore eu
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
    anim id est laborum.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; .box{
     width: 400px;
     height: 400px;
     border: 5px solid black;
     margin:20px auto;
     position: relative;
    }
    .item1,.item2{
     width: 150px;
     height: 150px;
    }

    .item1{
      background-color: #508AA8;
      position: absolute;
      bottom:0px;
    }
    .item2{
      background-color: #6F1A07;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result.&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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664298756723_file.jpeg" 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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664298756723_file.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fixed positioning&lt;br&gt;
The elements are also removed from the normal document flow. It is always fixed according to the viewport what is visible on the screen), it work's basically the same way absolute positioning works except the parent element is always the viewport. Even if the page is scrolled they stay exactly at the same position. It guarantees you it's always going to be there.&lt;/p&gt;

&lt;p&gt;Example.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class=”box”&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;div class=”item”&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
    reprehenderit in voluptate velit esse cillum dolore eu
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
    anim id est laborum.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box{
     width: 400px;
     height: 400px;
     border: 5px solid black;
     margin:20px auto;
     position: relative;
    }
    .item1,.item2{
     width: 150px;
     height: 150px;
    }

    .item1{
      background-color: #508AA8;
      position: fixed;
      left: 50px;
    }
    .item2{
      background-color: #6F1A07;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result.&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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664299531016_file.jpeg" 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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664299531016_file.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The box is fixed, it is always going to be stuck to our viewport.&lt;/p&gt;

&lt;p&gt;Sticky Positioning&lt;br&gt;
Position:sticky is used to position the elements based on the scroll position of the user. It is the containing element, it is similar to absolute positioning but only where certain conditions are met then it acts like fixed positioning. Sticky positioning is not supported in all web browsers.&lt;/p&gt;

&lt;p&gt;For example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;My Website&amp;lt;/h1&amp;gt;
    &amp;lt;h1&amp;gt;Cool&amp;lt;/h1&amp;gt;

    &amp;lt;nav&amp;gt;
     &amp;lt;ul&amp;gt;
      &amp;lt;li&amp;gt;Home&amp;lt;/li&amp;gt;
      &amp;lt;li&amp;gt;About&amp;lt;/li&amp;gt;
      &amp;lt;li&amp;gt;Contact&amp;lt;/li&amp;gt;
     &amp;lt;/ul&amp;gt;
    &amp;lt;/nav&amp;gt;

    &amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit,
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
    exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
    reprehenderit in voluptate velit esse cillum dolore eu
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
    anim id est laborum.&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nav{
     background-color: #6F1A07;
     color: white;
     position: sticky;
     top: 0;
    }

    p{
     width: 30%;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result.&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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664359401173_file.jpeg" 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%2Fpaper-attachments.dropbox.com%2Fs_B35774F5804ACEFAB2D0238E782DB210B63A1FC9D23C9EC9908A3135809DDF2F_1664359401173_file.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example above we notice that, the home, about and contact, are stuck to the top, it is going to switch between static positioning and fixed positioning.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding CSS positioning</title>
      <dc:creator>Chisom🦄</dc:creator>
      <pubDate>Wed, 28 Sep 2022 11:01:33 +0000</pubDate>
      <link>https://dev.to/chisom_kanu01/understanding-css-positioning-388b</link>
      <guid>https://dev.to/chisom_kanu01/understanding-css-positioning-388b</guid>
      <description>&lt;p&gt;Liquid syntax error: Tag '{%' was not properly terminated with regexp: /\%\}/&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Scopes of variables in JavaScript</title>
      <dc:creator>Chisom🦄</dc:creator>
      <pubDate>Mon, 26 Sep 2022 11:20:58 +0000</pubDate>
      <link>https://dev.to/chisom_kanu01/scopes-of-variables-in-javascript-1k0c</link>
      <guid>https://dev.to/chisom_kanu01/scopes-of-variables-in-javascript-1k0c</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br&gt;
The scope is the life of a variable, it holds the present set of variables and their values, variables in JavaScript work differently from other languages. In this article, we will talk about variable scopes in JavaScript, the types, and how to declare them. This article will help you if you are learning JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Variable Scopes In JavaScript?&lt;/strong&gt;&lt;br&gt;
Scope refers to where a variable is declared and where it can be accessed, that is an area where you can use it. It is the visibility of variables, variables are not visible outside the scope in which they are declared which means they either exist outside or within the scope they are declared. JavaScript variables are declared with the ‘var’ keyword.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of variable scopes&lt;/strong&gt;&lt;br&gt;
We have two types of variable scopes namely;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Global scope&lt;/li&gt;
&lt;li&gt;Local scopes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's dive in;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global Scope&lt;/strong&gt;&lt;br&gt;
 In global scope, variables are not declared inside a function they are declared outside of a function, which means they work from outside the function, they can be accessed and modified by any function.&lt;/p&gt;

&lt;p&gt;Let's look at an example;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`var userName = "Jane";

function modifyUserName(){
userName = "Chisom";
};
function showUserName () {
alert (userName);
};
alert (userName);
modifyUserName ();
showUserName();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;`&lt;br&gt;
In the example above, the variable userName is the global scope because it is declared outside the function, the value of a global variable can also be changed inside the function that simply means that even though my variable is declared I can use it from inside my function.&lt;/p&gt;

&lt;p&gt;In browser environment the global scope variables are controlled by window object but in node.js it is controlled by global object.&lt;/p&gt;

&lt;p&gt;Variables declared without var keyword inside any function is automatically a global variables.&lt;/p&gt;

&lt;p&gt;Global variables are mostly used for programming and are useful for cases where all the functions need to access the same data, we cannot declare many variables with the same name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Local Scope&lt;/strong&gt;&lt;br&gt;
 In local scope, variables are declared inside a function, It can be accessed only inside the function where it is declared.&lt;/p&gt;

&lt;p&gt;For example;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`function modifyUserName(){
var userName = “Jane”;
};
function showUserName () {
alert (userName);
};
alert (userName);
modifyUserName ();
showUserName();`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The variable “userName” in the example above is accessible inside the function. Since we cannot access a local variable outside it, the compiler generates an error.&lt;/p&gt;

&lt;p&gt;The same name of a local variable can be used in different functions because it is only recognized by the function which it is declared, when the function is executed a local variable is created.&lt;/p&gt;

&lt;p&gt;Note: if local variables and global variables have the same name then changing the value of one variable does not affect the value of the other variable.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`var userName = "Jane";

function modifyUserName(){
var userName = "Chisom";
};
function showUserName () {
alert (userName); // “Chisom”
};
alert (userName); // Jane
modifyUserName ();
showUserName();`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Any change in the local variable does not affect other functions of the program.&lt;/p&gt;

&lt;p&gt;It can only be accessed by the function statements in which it is declared.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
 In JavaScript, scopes are created by code blocks, functions, modules.&lt;/p&gt;

&lt;p&gt;Variables scopes are meant to be understood by every developer. In this article, we went over what variable scope is, and the types of variable scopes. I hope this article helped you understand the scopes of variables in JavaScript.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
