<?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: Emmanuel Kenneth</title>
    <description>The latest articles on DEV Community by Emmanuel Kenneth (@emmanuel49).</description>
    <link>https://dev.to/emmanuel49</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%2F1054589%2Fb717891f-92d7-467e-bee3-0581ac4e9911.png</url>
      <title>DEV Community: Emmanuel Kenneth</title>
      <link>https://dev.to/emmanuel49</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emmanuel49"/>
    <language>en</language>
    <item>
      <title>Why I want To Be A Front-End Developer And How HNG Will Help Acheive My Goals</title>
      <dc:creator>Emmanuel Kenneth</dc:creator>
      <pubDate>Wed, 29 Jan 2025 14:53:20 +0000</pubDate>
      <link>https://dev.to/emmanuel49/why-i-want-to-be-a-front-end-developer-and-how-hng-will-help-acheive-my-goals-40cp</link>
      <guid>https://dev.to/emmanuel49/why-i-want-to-be-a-front-end-developer-and-how-hng-will-help-acheive-my-goals-40cp</guid>
      <description>&lt;p&gt;As someone who loves to stay a lot online, I come across so many websites with beautiful user interfaces and smooth interactions everyday, most times I even pick a product or business over it's competitors just due to the fact that their sites have better user interface and user experience.&lt;br&gt;
I sat down so many times to ponder how this websites are made and how those beautiful and attention grabbing animations are put together and the technology behind them, I did some research about this to quench my curiosity and that is how I came across HTML, CSS and Javascript which are the basic building blocks of these websites I was so eager to learn these tools so I too can create these interfaces that are so soothing to the eye when you look at it. &lt;br&gt;
I went online and did further research so I can get straight to learning these tools and that's how I discovered that HTML, CSS and Javascript are not the only tools used in crafting websites, I started to discover libraries and frameworks like React, Angular, Vue, NodeJS, Tailwind CSS, Bootstrap, NextJS and many more that I cannot recall right now, As a newbie I was so eager to jump into these frameworks as they looked so shiny and exciting based on the description videos I watched about them refusing to learn the basics and that was how Jumped into React with just little knowledge of HTML and CSS(which I did not even complete my tutorials on) then along the line I struggled so badly as while learning React first I was always having difficulty understanding Javascript codes written within JSX as the tutor in these youtube videos probably assumed prior knowledge of Javascript and that was how I Jumped from tutorials to tutorials around youtube and the web as I had difficulty understanding Javascript.&lt;br&gt;
Along the line I met someone who is an established front end developer and told him of my problem and that was when he told me that I need to go back and understand the basics of HTML, CSS and Javascript after giving me some challenges to solve thereby accessing my poor skills of the basics.&lt;br&gt;
After several months of learning HTMLS, CSS and Javascript I came back to React and observed the journey was more smoother as the only issues I had was understanding hard React concepts unlike my first try where I struggled with Javascript and React concepts simultaneously.&lt;br&gt;
I am still on the journey right now, working hard on my front end skills while simultaneously doing school work, My goal is to make sure I am a cracked front end developer that can handle any task thrown at me efficiently as it is my passion like Steve Jobs says "the only way to do great work is to love what you do".&lt;/p&gt;

&lt;p&gt;One of my motivations for choosing to be a Front-end developer is for career reasons, I would love to make a living of being a front end developer cause for me it would be a great honor to also make a living off what I love to do and that is why at the beginning of the first month of 2025 I took  a decision to apply for the HNG internship program, my reasons being recommendations of friends, my friends which  I met on social media or twitter to be precise who have gone through this program have told me how the HNG internship prepares you for a real work environment, how tight deadlines are which is a common phenomenon at workplaces and how much hours you would have to spend completing tasks and many meetings so my aim is to get a feeling of how a work environment feels like and what it entails so I am actually prepared for jobs, I plan to make friends during this program who could motivate me anytime I have to deal with burnouts and possibly meet the mentors in my track so I can be properly guided.&lt;br&gt;
Now we have come to the end of the article I would love to say that I hope this internship program is a success for me and I get to the final stage of this program cause it is one of my main goals for enrolling for this program as it would be a great addition to my CV while job hunting in the future.&lt;/p&gt;

&lt;p&gt;A the end of this program I expect myself to be fully ready for a work environment and to have met more front end developer like myself that I could possibly learn from.&lt;/p&gt;

&lt;p&gt;If you need an interactive website with stunning UI for your business endeavors you can hire React developers right here &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://hng.tech/hire/reactjs-developers" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhng.tech%2Fmedia%2Fimages%2Fhng-tech.png" height="120" class="m-0" width="256"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://hng.tech/hire/reactjs-developers" rel="noopener noreferrer" class="c-link"&gt;
          Find and Hire Elite ReactJs Developers | HNG
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Hire the best Developers available for hire and freelance jobs anywhere in the world. Find Developers that suit your needs — chat with us now.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhng.tech%2Ffavicon.ico" width="800" height="400"&gt;
        hng.tech
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Props in React</title>
      <dc:creator>Emmanuel Kenneth</dc:creator>
      <pubDate>Wed, 23 Aug 2023 17:54:44 +0000</pubDate>
      <link>https://dev.to/emmanuel49/props-in-react-1mjh</link>
      <guid>https://dev.to/emmanuel49/props-in-react-1mjh</guid>
      <description>&lt;p&gt;Before we jump straight into this article, for you to follow along you must have a good understanding of what components in react are and some basic understanding of Javascript.&lt;br&gt;
In this article we will be explaining what props are and how they are used in react and then we will dive into react code to see how props works and how they are used to share values between components.&lt;br&gt;
Note: Props can only be passed from a parent component to a child components as react has a unidirectional data flow.&lt;br&gt;
Props is a short form for properties, it is a way of sharing values between components or to put it in a shorter way it is an argument passed into a component, with the use of props we are able to to pass data from a parent component to a child component.&lt;br&gt;
 Now let’s take a look at how components share props and what problems they solve now that we know what they are;&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;function&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;here&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code above we can observe see that we have two button components rendered in the app component which will show the following in the browser&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PQ03TUU2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vv5mr9rnj9zgpa3x0jlg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PQ03TUU2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vv5mr9rnj9zgpa3x0jlg.png" alt="Image description" width="800" height="41"&gt;&lt;/a&gt;&lt;br&gt;
As you can see the two buttons show the same thing but you might ask what if we want these buttons to show different values or lets just say for example we want the second button to display don't click me, this is where props comes in handy to get over this obstacle, now we will create a props in the child component "Button" called text and use it as a variable in each button component rendered inside the app component;&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;function&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click me&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Dont click me&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now with this we have successfully changed the text values in the two different button components thereby overcoming the obstacle we talked about above, this code will show the following in the browser&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FzkQTKSm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fs8c300d7sosdxfd8px.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FzkQTKSm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fs8c300d7sosdxfd8px.png" alt="Image description" width="800" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now this is not all we can do with props, we can also utilize the power of props to apply different styles across the two buttons;&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;function&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;btnstyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;btnstyle&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click me&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;white&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Dont click me&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;black&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code snippet above we are able to pass values in objects as props as we could change the style of the button using the properties in "btnStyle" object. The result of our code snippet is shown below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oSpw4Swv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u99jq59m2kkerug2u6g0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oSpw4Swv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u99jq59m2kkerug2u6g0.png" alt="Image description" width="464" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;With this knowledge given to you above you should be able to pass props between components and lessen the code you have to write.&lt;br&gt;
For more Information on props and how they work:&lt;a href="https://react.dev/learn/passing-props-to-a-component"&gt;https://react.dev/learn/passing-props-to-a-component&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Responsive web design using CSS Media queries</title>
      <dc:creator>Emmanuel Kenneth</dc:creator>
      <pubDate>Thu, 17 Aug 2023 15:39:56 +0000</pubDate>
      <link>https://dev.to/emmanuel49/responsive-web-design-using-css-media-queries-4190</link>
      <guid>https://dev.to/emmanuel49/responsive-web-design-using-css-media-queries-4190</guid>
      <description>&lt;p&gt;In this article we will be explaining what media queries are,  the use of media queries in responsive web design , why they must be used, the challenges that media queries solve, and how this challenges were overcome before the invention of media queries, but there will be no CSS code as examples as this only talks about CSS media queries and it's benefits.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are media queries
&lt;/h2&gt;

&lt;p&gt;First of all let's look at what a CSS  media query is and what it does : According to the MDN documentation "Media queries allow you to apply CSS styles depending on a device's general type (such as print vs. screen) or other characteristics such as screen resolution or browser viewport width. &lt;br&gt;
According to the definition above CSS media queries allows  you to apply styles on a website depending on a devices characteristics such as print or screen.&lt;br&gt;
As this article focuses on responsive web design using CSS media queries we will only be looking at how media queries work based on the size of a screen(screen resolution).&lt;/p&gt;

&lt;h2&gt;
  
  
  Use of media queries
&lt;/h2&gt;

&lt;p&gt;Now how does CSS media query apply to responsive  web design?&lt;br&gt;
When writing out CSS code for the design of a website the CSS code output only tells the frontend developer how the website will look based on he/she's devices screen  size or browser viewport height and width but the issue is when this site is pushed into production users will not always have the same screen size as the frontend developer and as a result the whole site might look messy and terrible if the user and front end developers screen size are far apart and in some cases some elements won't render properly and some elements might not even show at all.&lt;br&gt;
This is where the developer has to use CSS media queries along with browser developer tools which mostly come as a package with the browser, with the use of the browser developer tools the frontend developer is able to simulate differing screen sizes and is able to see how the CSS code output looks across  different screen sizes and with this the frontend developer is able to go back to his CSS code, create a media query for different screen widths and heights to apply a different  CSS style to an element different from the one originally applied therefore making the site still look good and beautiful on the widths and heights specified in the media query and with this the issue of the site looking messy on different screen is eliminated making the site look pleasant for all users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before media queries
&lt;/h2&gt;

&lt;p&gt;Now before the use of media queries responsive web design was achieved using methods like:&lt;br&gt;
*Flexbox and grid, viewport units (i.e vw and vh)&lt;br&gt;
*Mobile subdomains which involved creating one site for users with big screens like laptops and tablets and users with small screen such as mobile devices, fluid images.&lt;br&gt;
*JavaScript and user agent sniffing where JavaScript is employed to detect the device screen size of a user and apply styles accordingly.&lt;/p&gt;

&lt;p&gt;However the above methods are very ineffective and are not used by frontend developers in the present day as media query already provides a very efficient and better alternatives to this methods.&lt;br&gt;
Thanks to media queries every user is able to enjoy the internet on whatever device they are using while simultaneously making the work of frontend developers easier as they don't have to go through rigorous methods to apply styles across different screens.&lt;/p&gt;

&lt;p&gt;For more information on media queries and a deeper dive with code examples on how media queries are implemented I recommend this MDN article:&lt;a href="https://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;opi=89978449&amp;amp;url=https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries&amp;amp;ved=2ahUKEwjLorm5-9GAAxUxTUEAHYgrAKMQFnoECAkQAQ&amp;amp;usg=AOvVaw1v_p3zTt_PZsCrt2oJc1wF"&gt;https://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;opi=89978449&amp;amp;url=https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries&amp;amp;ved=2ahUKEwjLorm5-9GAAxUxTUEAHYgrAKMQFnoECAkQAQ&amp;amp;usg=AOvVaw1v_p3zTt_PZsCrt2oJc1wF&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>var, let and const</title>
      <dc:creator>Emmanuel Kenneth</dc:creator>
      <pubDate>Sat, 15 Apr 2023 13:33:15 +0000</pubDate>
      <link>https://dev.to/emmanuel49/var-let-and-const-1ke8</link>
      <guid>https://dev.to/emmanuel49/var-let-and-const-1ke8</guid>
      <description>&lt;p&gt;var, let and const are keywords used in JavaScript for the declaration of variables.&lt;br&gt;
Now before we take a look at these keywords and what makes each of them unique in JavaScript, we will have to explain two JavaScript concepts which I believe will be necessary in order to follow along with this article. These concepts are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Variables&lt;/li&gt;
&lt;li&gt; Scope&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now we will be looking at these two concepts in more detail;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Variables: A variable is a container used for storing values in JavaScript. This values could be data types such as strings, numbers, arrays, objects etc. When variables are declared they must be assigned a value or the variable will be automatically assigned a value of “undefined”.
     Take the code as an example below;
&lt;/li&gt;
&lt;/ol&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;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// a has been declared with var but no value was assigned to the variable identifier “a”; &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// this will print a value of undefined to the console&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 40 has been assigned to the variable b&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//this will print 40 to the console as 40 has been assigned to the variable b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;br&gt;
.&lt;br&gt;
“in the variable above a is called the identifier and = to here is called an assignment operator”.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Scope: This is an area in a JavaScript which a variable can be accessed.
We have three types of scope in JavaScript which include:&lt;/li&gt;
&lt;li&gt;Block Scope: This is a type of scope in which variables can only be accessed within a block ({}). Here variables declared within this block cannot be accessed from outside the block, even if the block is within a function block scoped variables still have no access to the function.&lt;/li&gt;
&lt;li&gt;Function scope: Function scoped variables are accessed from only within a function and can’t be accessed outside the function. They are also known as local scope.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Global scope: Variables that are globally scoped can be accessed from anywhere within a JavaScript code even from within a function or block. Here there is no restriction on where or where not to use a variable as the values in a variable can be accessed from anywhere.&lt;br&gt;
Now that we are done explaining these two concepts let’s move unto the next phase which is explaining what var, let and const are by taking a look at their characteristics under scopes, re-assignment and re-declaration.&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              var
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;var is the oldest keyword for declaring variables and has been around for as long as JavaScript itself.&lt;br&gt;
Scope&lt;br&gt;
Variables declared with var are function scoped meaning once declared in a function they can be accessed from anywhere within a function and cannot be accessed outside the function.&lt;br&gt;
For example;&lt;br&gt;
&lt;/p&gt;


&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;example1&lt;/span&gt; &lt;span class="p"&gt;()&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="nx"&gt;example1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// when the function is called here the console will print 10&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// the console here will print “a is not defined” as it can’t access the variable (var a) within the function&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because var is function scoped even variables declared with var inside a block within a function can still be accessed by the function outside the block.&lt;br&gt;
For example&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;function&lt;/span&gt; &lt;span class="nx"&gt;example2&lt;/span&gt; &lt;span class="p"&gt;(){&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;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;example2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// the function prints 12 to the console as it can still access the variable (var b) within the block&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       Re-declaration and Re-assignment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Variables declared with var can be re-declared and re-assigned in a JavaScript program.&lt;br&gt;
For example in the program below the variable ( var a) is re-declared,&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// here the variable a is re-declared and assigned a new value of 40&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// this will print 40 to the console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables declared with var can also be re-assigned “that is to chnge the value of a variable”.&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// here instead of the variable a been re-declared with the var keyword it is given a new value &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this will print the new value of 60 to the console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Although var allows re-declaration of variables it is not a good practice&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                        let
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;let is a keyword for declaring variables in JavaScript, it was introduced in ES6 along with const. Unlike var which is as old as JavaScript itself, let and const were introduced in 2015.&lt;br&gt;
Scope&lt;br&gt;
Variables declared using the let keyword are block scoped, once variables are declared in a block using the let keyword they cannot be accessed outside the block.&lt;br&gt;
For example&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="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//the console will print 10&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// here the console prints “a is not defined”&lt;/span&gt;
&lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;can&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="nx"&gt;access&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;within&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even a function can’t access a let variable outside the block but only from within the block&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;function&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this will print 40 to the console as the function can only access the variable here&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;// this will print an error of undefined as the function cannot access the variable here&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Re-declaration and Re-assignment&lt;br&gt;
Variables declared with let cannot be re-declared,&lt;br&gt;
For example&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="nx"&gt;Let&lt;/span&gt; &lt;span class="nx"&gt;a&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="nx"&gt;Let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// this is going to give an error (Identifier 'a' has already been declared) to the console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This doesn’t apply if the variables are declared in different scopes.&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;let&lt;/span&gt; &lt;span class="nx"&gt;a&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;// at the global scope&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//this will print 10 to the console&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// at the function scope&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this prints 20 to the console when the function is called&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// at the block scope&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this prints 30 to the console when the function is callled&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


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

&lt;/div&gt;



&lt;p&gt;Variables declared with let can be re-assigned a value even within the same block and it won’t cause any issues&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;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// the new value of 20 assigned to a will print to the console without any issues&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                  const
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Variables declared with const are a constant reference to a variable.&lt;br&gt;
const was introduced to JavaScript in 2015 along with let, although they are similar in some areas they have differences, we will see what is similar and what is different as we go through its characteristics.&lt;/p&gt;

&lt;p&gt;Scope&lt;br&gt;
Since const and let have the same scope (block scope) I don’t think I will need to cover it again in order not to waste much of your time.&lt;br&gt;
Re-declaration and Re-assignment&lt;br&gt;
Variables declared with let are similar to variables declared with const as they don’t allow re-declaration of variables.&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;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// this will print (Identifier 'a' has already been declared) to the console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables declared with const do not allow re-assignment&lt;br&gt;
For example&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;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this will print the error (Assignment to constant variable.) to the console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But this doesn’t mean the values of an array or an object can’t be changed added, deleted or re-assigned when they are assigned to a variable declared with const.&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;const&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;watermelon&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;carrots&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;kiwi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// here the full fruits array is printed to the console&lt;/span&gt;
&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// this removes the last element in the array which is "kiwi" in this case  &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//here the fruits arrays printed in the console is ["watermelon", "carrots", "apple"]&lt;/span&gt;
 &lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;banana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this adds banana to the end of the array so the console prints ["watermelon", "carrots", "apple", "banana"]&lt;/span&gt;
 &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="c1"&gt;// the array values can also be re-assigned&lt;/span&gt;
 &lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tomato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// this replaces "watermelon" with "tomato" in the array&lt;/span&gt;
 &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// this prints ['tomato', 'carrots', 'apple', 'banana'] to the console&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Object values can be manipulated and added.&lt;br&gt;
For example;&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;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Joe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// as you can see ( {name: 'Joe', Age: 24} ) is printed to the console&lt;/span&gt;
&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;6.5ft&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// this adds a height property to the person object and assigns a value of 6.5ft to it&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// the console now prints ({name: 'Joe', Age: 24, height: '6.5ft'});&lt;/span&gt;
&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// this takes the name property that is assigned a value of Joe in the person object and re-assigns john to it&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// this prints ({name: 'John', Age: 24, height: '6.5ft'}) to the console&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now that we have come to the end of the article I want to advise developers new to JavaScript to avoid the usage of var as it causes many problems while running code, let should be used for values that can change in the program while const should be used when you are very sure that the value of the variable cannot be changed.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Evolution of CSS</title>
      <dc:creator>Emmanuel Kenneth</dc:creator>
      <pubDate>Tue, 04 Apr 2023 10:24:31 +0000</pubDate>
      <link>https://dev.to/emmanuel49/the-evolution-of-css-4hg6</link>
      <guid>https://dev.to/emmanuel49/the-evolution-of-css-4hg6</guid>
      <description>&lt;p&gt;Over the years CSS goes through major changes which leads to the implementation of new features which Frontend web developers make use of to beautify websites.&lt;br&gt;
Now before we go into the topic let's first take a look at what CSS is and what it does in the web browser.&lt;br&gt;
CSS(Cascading StyleSheet) is a StyleSheet document used to describe the presentation of a document written in HTML or XML. It describes how elements should be rendered on a web page and on different screens through the use of media queries.&lt;br&gt;
Now let's go into today's topic;&lt;br&gt;
CSS gets new features added over the years by W3C specification, Each of the levels of CSS builds upon the last by adding more options to developers to describe how a HTML element should be rendered on a web page.&lt;br&gt;
This CSS with new features added is called a new level, and as of now we have four levels of CSS which are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CSS level 1&lt;/li&gt;
&lt;li&gt;CSS level 2&lt;/li&gt;
&lt;li&gt;CSS level 3&lt;/li&gt;
&lt;li&gt;CSS level 4 (although this isn't an entirely new level as this has no single W3C Specification)
Now let's take a look at each level of CSS to see what features they had and how each new level built upon the past levels.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;CSS1&lt;/strong&gt;&lt;br&gt;
The first W3C specification of CSS was published on the 17th of December 1996, Hakon Wium Like and Bert Bos are both credited as the original inventors. It was the first CSS level to become an official W3C specification.&lt;br&gt;
Some of it's features include&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Font properties such as typeface and emphasis.&lt;/li&gt;
&lt;li&gt;Color of text, backgrounds and all other elements.
-Text attributes such as spacing between words, letters and line of texts&lt;/li&gt;
&lt;li&gt;Unique identification and general classification of groups of attributes&lt;/li&gt;
&lt;li&gt;Margin, padding, border and positioning for elements
The W3C no longer recommends the CSS level 1 recommendation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CSS2&lt;/strong&gt;&lt;br&gt;
CSS level 2 specification was developed by the W3C and was published as a recommendation in May 1998, As a superset of CSS1 CSS2 includes a number of new features which include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Absolute, fixed and relative positioning of elements&lt;/li&gt;
&lt;li&gt;Z-index&lt;/li&gt;
&lt;li&gt;Concept of media types&lt;/li&gt;
&lt;li&gt;Support for aural StyleSheet&lt;/li&gt;
&lt;li&gt;Bi-directional text&lt;/li&gt;
&lt;li&gt;new font features such as shadows
The W3C no longer maintains this recommendation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CSS 2.1&lt;/strong&gt;&lt;br&gt;
This  is a revision of CSS level 2. It is also known as CSS level 2 revision 1.&lt;br&gt;
No new features where implemented here rather it fixes the error of CSS2 and adds already implemented browser extensions to the specification.&lt;br&gt;
It was officially published as a recommendation on June 7 2011.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS3&lt;/strong&gt;&lt;br&gt;
CSS3 is divided into multiple seperate documents called modules.&lt;br&gt;
Each of the modules extends features defined in CSS2, preserving backwards compatibility.&lt;br&gt;
Due to modularization different modules have different stability and statuses.&lt;br&gt;
A handful of modules have candidate recommendation status and are considered fairly stable.&lt;br&gt;
Some of the main module features are&lt;br&gt;
CSS3-background, CSS3-box, CSS-fonts, CSS-media queries&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS4&lt;/strong&gt;&lt;br&gt;
There is no single specification for CSS4 because the specification has been split into multiple different modules which level independently.&lt;/p&gt;

&lt;p&gt;The evolution doesn't stop here as modules are developed by the CSS Working group, From time to time the CSS group publishes an array of whole modules that are considered stable enough to be implemented by browser developers.&lt;br&gt;
In conclusion CSS evolved from CSS1 to CSS3 thereby producing more ways by which frontend web developers could use tu style their sites and make them more beautiful and complex with properties such as animation.&lt;br&gt;
After going through stages CSS3 is the W3c recommendation that is used by most Frontend Web Developers today in the styling of their websites&lt;/p&gt;

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