<?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: Akshay R</title>
    <description>The latest articles on DEV Community by Akshay R (@akshayrak).</description>
    <link>https://dev.to/akshayrak</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%2F621125%2F93b0541c-2679-47db-b1a0-42c1c1943bb8.png</url>
      <title>DEV Community: Akshay R</title>
      <link>https://dev.to/akshayrak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akshayrak"/>
    <language>en</language>
    <item>
      <title>Recursion - Data Structures and Algorithms</title>
      <dc:creator>Akshay R</dc:creator>
      <pubDate>Sun, 15 Aug 2021 17:43:04 +0000</pubDate>
      <link>https://dev.to/akshayrak/recursion-data-structures-and-algorithms-jpj</link>
      <guid>https://dev.to/akshayrak/recursion-data-structures-and-algorithms-jpj</guid>
      <description>&lt;p&gt;I am planning to write a series of posts covering complete Data Structures and algorithms in beginner friendly way. I will be using java to explain the examples.&lt;/p&gt;

&lt;p&gt;In Data Structures and Algorithms Recursion is one of the first concept which is very important to understand, since it makes you think in cycles.Its like a fractal but it should have an end.&lt;/p&gt;

&lt;p&gt;Example Problems on Recursion:&lt;br&gt;
&lt;a href="https://github.com/akshayrak/Data-Structures-and-Algorithms/tree/main/src/recursion"&gt;https://github.com/akshayrak/Data-Structures-and-Algorithms/tree/main/src/recursion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Important points to remember in Recursion:&lt;/p&gt;

&lt;p&gt;1.Recursive function is a function that calls itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static int factorial(int n) {
        return n*factorial(n-1);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Recursive function should cover all the conditions that could arise.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static int factorial(int n) {
        if(n==1||n==0) {
            return 1;
        }
        return n*factorial(n-1);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.We should also take care of exceptional situations also.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static int factorial(int n) {
        if(n==1||n==0) {
            return 1;
        }
        if(n&amp;lt;0) {
            return -1;
        }
        return n*factorial(n-1);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.It uses Stack Memory to remember the functions it has called, so once the last function is executed, it keeps popping out the functions in Last in First out order.&lt;br&gt;
Note: Stack is one of the data structure that follows first in last out or last in first out, just think about stack of books &lt;/p&gt;

&lt;p&gt;5.All the problems that can be solved using Recursion can also be solved using iteration, iteration is efficient when you compared to space and time complexity of recursion but recursion is easy to code than iteration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static int factorial(int n) {
                int count = 1;
        for(int i = 2;i&amp;lt;=n;i++){
                   count = count*i;
           }
           return count;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.So we can use recursion only when code clarity is more important than the time and space complexity, so we wont be using recursion in time critical cases (devices where life depends on time) and low storage cases (low stack memory devices).&lt;/p&gt;

&lt;p&gt;7.We commonly use recursion in trees.&lt;/p&gt;

&lt;p&gt;8.Recursion can be very slow if not implemented properly.&lt;/p&gt;

&lt;p&gt;Let me know if I need to add anything else or in case of any doubts comment down below &lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@mikakor?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Mika Korhonen&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/recursive?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>algorithms</category>
      <category>datastructures</category>
      <category>career</category>
    </item>
    <item>
      <title>Learn CSS by Playing Games - No Nightmares</title>
      <dc:creator>Akshay R</dc:creator>
      <pubDate>Tue, 10 Aug 2021 18:15:24 +0000</pubDate>
      <link>https://dev.to/akshayrak/learn-css-by-playing-games-no-nightmares-2841</link>
      <guid>https://dev.to/akshayrak/learn-css-by-playing-games-no-nightmares-2841</guid>
      <description>&lt;p&gt;Every frontend developers nightmare is not able to positioning or align an element where it needs to be and when you try to do something UI starts to break.&lt;/p&gt;

&lt;p&gt;Flexbox and CSS Grid Layout are really good and easy way to solve the issues related to aligning, position and bringing responsiveness to the webpage.&lt;/p&gt;

&lt;p&gt;But the problem is we humans can't remember all the properties of Flexbox and Grid, but we can train ourselves to remember by doing it again and again. But it is no fun and we often get bored and google each and every time to figure out how a text is aligned.&lt;/p&gt;

&lt;p&gt;What if there is a way to master CSS in a fun way, what if it was a game. Most of the developers faced same issue when it comes to tutorials, they are no fun. So some of the smart developers came up with some of the following Games to master CSS.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Here is the list:&lt;/u&gt;&lt;/p&gt;

&lt;ol&gt;

&lt;li&gt; &lt;a href="https://flexboxfroggy.com/"&gt;Flexbox Froggy&lt;/a&gt; - Game to master Flexbox&lt;/li&gt;
&lt;li&gt; &lt;a href="http://www.flexboxdefense.com/"&gt;Flexbox Defense&lt;/a&gt; - Game to master Flexbox&lt;/li&gt;
&lt;li&gt; &lt;a href="https://flukeout.github.io/"&gt;CSS Diner&lt;/a&gt; - Game to master CSS selectors&lt;/li&gt;
&lt;li&gt; &lt;a href="https://mastery.games/flexboxzombies//"&gt;Flexbox Zombies&lt;/a&gt; - Game to master Flexbox (Must Try)&lt;/li&gt;
&lt;li&gt; &lt;a href="https://cssgridgarden.com/"&gt;Grid Garden&lt;/a&gt; - Game to master CSS Grid Layout&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is one more game to master CSS Grid but I didn't try since was little bit priced high&lt;/p&gt;

&lt;ol start="6"&gt;
&lt;li&gt; &lt;a href="https://gridcritters.com/"&gt; Grid Critters&lt;/a&gt; - Game to master CSS Grid&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
These are some of the quick list of CSS games, there are lot of such games to master many of the technology.
&lt;br&gt;
Let me know if I missed any.
&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@pankajpatel?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Pankaj Patel&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/css?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>This Is All The HTML You Need To Know</title>
      <dc:creator>Akshay R</dc:creator>
      <pubDate>Wed, 04 Aug 2021 06:24:02 +0000</pubDate>
      <link>https://dev.to/akshayrak/this-all-the-html-you-need-5h27</link>
      <guid>https://dev.to/akshayrak/this-all-the-html-you-need-5h27</guid>
      <description>&lt;p&gt;Everyone who are into front-end web development will have this question, "How much HTML should I know?", well here is the answer.&lt;br&gt;
There are some tags that are most commenly used, which can get your 90% of the job done, so if you just know these 90%, rest 10% you can google.&lt;/p&gt;

&lt;p&gt;So just go through the below code and if you could understand it your most of the work is done&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;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;meta charset="UTF-8"&amp;gt;
        &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;
        &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
        &amp;lt;meta name="author" content="Akshay"&amp;gt;
        &amp;lt;meta name="description" content="mostly used html tags"&amp;gt;
        &amp;lt;meta name="keywords" content="html, complete html, beginners"&amp;gt;
        &amp;lt;title&amp;gt;Title&amp;lt;/title&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;h1&amp;gt;This is h1&amp;lt;/h1&amp;gt;
        &amp;lt;h2&amp;gt;This is h2&amp;lt;/h2&amp;gt;
        &amp;lt;h3&amp;gt;This is h3&amp;lt;/h3&amp;gt;
        &amp;lt;h4&amp;gt;This is h4&amp;lt;/h4&amp;gt;
        &amp;lt;h5&amp;gt;This is h5&amp;lt;/h5&amp;gt;
        &amp;lt;h6&amp;gt;This is h6&amp;lt;/h6&amp;gt;
        &amp;lt;br/&amp;gt;
        horizontal line 
        &amp;lt;hr/&amp;gt;
        &amp;lt;!-- This is a comment which can only be seen in code,browsers ignores it, useful for the developers to understand the code better --&amp;gt;
        &amp;lt;p&amp;gt;This is a paragraph tag&amp;lt;/p&amp;gt;
        &amp;lt;b&amp;gt;this is bold&amp;lt;/b&amp;gt;
        &amp;lt;i&amp;gt;Italic&amp;lt;/i&amp;gt;
        &amp;lt;u&amp;gt;underlined&amp;lt;/u&amp;gt;
        &amp;lt;sub&amp;gt;subscript&amp;lt;/sub&amp;gt;
        &amp;lt;sup&amp;gt;superscript&amp;lt;/sup&amp;gt;
        &amp;lt;header&amp;gt;
            &amp;lt;nav&amp;gt;&amp;lt;/nav&amp;gt;
        &amp;lt;/header&amp;gt;
        &amp;lt;main&amp;gt;
            &amp;lt;article&amp;gt;
                &amp;lt;section&amp;gt;
                    &amp;lt;img width="100" height="100" src="http://link" alt="image text" /&amp;gt;
                    &amp;lt;ul&amp;gt;
                        &amp;lt;li&amp;gt;item1&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item2&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item3&amp;lt;/li&amp;gt;
                    &amp;lt;/ul&amp;gt;
                    &amp;lt;ol type="A"&amp;gt;
                        &amp;lt;li&amp;gt;item1&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item2&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item3&amp;lt;/li&amp;gt;  
                    &amp;lt;/ol&amp;gt;
                    &amp;lt;dl&amp;gt;
                        &amp;lt;dt&amp;gt;Item1&amp;lt;/dt&amp;gt;
                        &amp;lt;dd&amp;gt;description of item1&amp;lt;/dd&amp;gt;
                        &amp;lt;dt&amp;gt;Item2&amp;lt;/dt&amp;gt;
                        &amp;lt;dd&amp;gt;description of item2&amp;lt;/dd&amp;gt;
                    &amp;lt;/dl&amp;gt;
                    &amp;lt;table&amp;gt;
                        &amp;lt;thead&amp;gt;
                            &amp;lt;caption&amp;gt;Table Title&amp;lt;/caption&amp;gt;
                            &amp;lt;tr&amp;gt;
                                &amp;lt;th&amp;gt;title1&amp;lt;/th&amp;gt;
                                &amp;lt;th&amp;gt;title2&amp;lt;/th&amp;gt;
                                &amp;lt;th&amp;gt;title3&amp;lt;/th&amp;gt;
                            &amp;lt;/tr&amp;gt;
                        &amp;lt;/thead&amp;gt;
                        &amp;lt;tbody&amp;gt;
                            &amp;lt;tr&amp;gt;
                                &amp;lt;td&amp;gt;item1&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item2&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item3&amp;lt;/td&amp;gt;
                            &amp;lt;/tr&amp;gt;
                            &amp;lt;tr&amp;gt;
                                &amp;lt;td colspan="2"&amp;gt;item1&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item2&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item3&amp;lt;/td&amp;gt;
                            &amp;lt;/tr&amp;gt;
                        &amp;lt;/tbody&amp;gt;
                    &amp;lt;/table&amp;gt;
                    &amp;lt;hr&amp;gt;
                    &amp;lt;span&amp;gt;text1&amp;lt;/span&amp;gt;
                    &amp;lt;span&amp;gt;text2&amp;lt;/span&amp;gt;
                    &amp;lt;hr&amp;gt;
                    &amp;lt;div&amp;gt;text1&amp;lt;/div&amp;gt;
                    &amp;lt;div&amp;gt;text2&amp;lt;/div&amp;gt;
                &amp;lt;/section&amp;gt;
                &amp;lt;section&amp;gt;
                    &amp;lt;aside&amp;gt;
                        &amp;lt;video src="somevideo.mp4" loop poster="thumbnail.jpg" autoplay controls width="100" height="100"&amp;gt;some video text&amp;lt;/video&amp;gt;
                        &amp;lt;iframe src="http://link" width="100" height="100" frameborder="0" allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
                    &amp;lt;/aside&amp;gt;
                    &amp;lt;form action=""&amp;gt;
                        &amp;lt;label for=""&amp;gt;something&amp;lt;/label&amp;gt;
                        &amp;lt;input type="text" value="something" placeholder="something" &amp;gt;
                        &amp;lt;input type="password"&amp;gt;
                        &amp;lt;input type="date"&amp;gt;
                        &amp;lt;input type="email"&amp;gt;
                        &amp;lt;input type="range"&amp;gt;
                        &amp;lt;input type="file"&amp;gt;
                        &amp;lt;input type="checkbox"&amp;gt;
                        &amp;lt;input name ="gender" type="radio" value="male"&amp;gt;
                        &amp;lt;input name ="gender" type="radio" value="female"&amp;gt;
                        &amp;lt;select name="itemSelect" id="itemSelect"&amp;gt;
                            &amp;lt;option value="item1"&amp;gt;item1&amp;lt;/option&amp;gt;
                            &amp;lt;option value="item2"&amp;gt;item2&amp;lt;/option&amp;gt;
                            &amp;lt;option value="item3"&amp;gt;item3&amp;lt;/option&amp;gt;
                            &amp;lt;option value="item4"&amp;gt;item4&amp;lt;/option&amp;gt;
                        &amp;lt;/select&amp;gt;
                        &amp;lt;textarea name="textarea" id="" cols="30" rows="10"&amp;gt;some text&amp;lt;/textarea&amp;gt;
                        &amp;lt;input type="submit"&amp;gt;
                        &amp;lt;button type="submit"&amp;gt;click here&amp;lt;/button&amp;gt;
                    &amp;lt;/form&amp;gt;
                &amp;lt;/section&amp;gt;
            &amp;lt;/article&amp;gt;
        &amp;lt;/main&amp;gt;
        &amp;lt;footer&amp;gt;
            &amp;lt;a href="http://google.com"&amp;gt;google&amp;lt;/a&amp;gt;
            &amp;lt;a href="http://google.com" target="_blank"&amp;gt;google in new tab&amp;lt;/a&amp;gt;
        &amp;lt;/footer&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you didn't understand something, just go through the explanation.&lt;/p&gt;

&lt;p&gt;Explanation:&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;html&amp;gt;&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is the container for all the html tags&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;head&amp;gt;&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is used to represent head of the document, this is where all the metadata goes&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;meta&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is used to inform the browsers and web crawlers what the document is about and how it need to be represented, meta tags are really important for for SEO purposes&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;title&amp;gt;&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is used to declare the title of the webpage&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;body&amp;gt;&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This where the actual content of the webpage resides&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;This is h1&amp;lt;/h1&amp;gt;
        &amp;lt;h2&amp;gt;This is h2&amp;lt;/h2&amp;gt;
        &amp;lt;h3&amp;gt;This is h3&amp;lt;/h3&amp;gt;
        &amp;lt;h4&amp;gt;This is h4&amp;lt;/h4&amp;gt;
        &amp;lt;h5&amp;gt;This is h5&amp;lt;/h5&amp;gt;
        &amp;lt;h6&amp;gt;This is h6&amp;lt;/h6&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the tags used to write the headings and sub heading in the webpage, h1 is the main or bigger heading h6 is the smaller&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;br/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is a break tag used to give a one line break and it is a block level tag&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;hr/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is a horizontal line tag and it is also a block level element&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;p&amp;gt;This is a paragraph tag&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tag is used to write a paragraph text, for example in a blog post we can use p tag for writing main content of the blog post.&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;b&amp;gt;this is bold&amp;lt;/b&amp;gt;
        &amp;lt;i&amp;gt;Italic&amp;lt;/i&amp;gt;
        &amp;lt;u&amp;gt;underlined&amp;lt;/u&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These tags are used to format text into bold, italic and underlined, we can use all three of them on a single text&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;sub&amp;gt;subscript&amp;lt;/sub&amp;gt;
        &amp;lt;sup&amp;gt;superscript&amp;lt;/sup&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are subscript and superscript&lt;br&gt;
subscript Example: H2O&lt;br&gt;
superscript Example: a&lt;sup&gt;2&lt;/sup&gt;+b&lt;sup&gt;2&lt;/sup&gt;&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;header&amp;gt;
            &amp;lt;nav&amp;gt;&amp;lt;/nav&amp;gt;
        &amp;lt;/header&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;header and nav tags are used to create a header and navigation bar&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;main&amp;gt;&amp;lt;/main&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is to write the main content of the webpage&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;article&amp;gt;&amp;lt;/article&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is used to write a article, may be a blog post&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;section&amp;gt;&amp;lt;/section&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is used to create a section, most of the time we need more than one section to write or display on an webpage&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;aside&amp;gt;&amp;lt;/aside&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is used to display content that is not directly related to the main objective of the webpage, one example might be for displaying advertisement we can use aside tag&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;ul&amp;gt;
                        &amp;lt;li&amp;gt;item1&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item2&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item3&amp;lt;/li&amp;gt;
                    &amp;lt;/ul&amp;gt;
                    &amp;lt;ol type="A"&amp;gt;
                        &amp;lt;li&amp;gt;item1&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item2&amp;lt;/li&amp;gt;
                        &amp;lt;li&amp;gt;item3&amp;lt;/li&amp;gt;  
                    &amp;lt;/ol&amp;gt;
                    &amp;lt;dl&amp;gt;
                        &amp;lt;dt&amp;gt;Item1&amp;lt;/dt&amp;gt;
                        &amp;lt;dd&amp;gt;description of item1&amp;lt;/dd&amp;gt;
                        &amp;lt;dt&amp;gt;Item2&amp;lt;/dt&amp;gt;
                        &amp;lt;dd&amp;gt;description of item2&amp;lt;/dd&amp;gt;
                    &amp;lt;/dl&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ul is used to display unordered list, it displays the list in bullet points&lt;br&gt;
li is nothing but a list item, which explains itself&lt;br&gt;
ol is used to display ordered list, it displays list in numerical order or alphabetical order&lt;br&gt;
dl is used to display a descriptive list&lt;br&gt;
dt is a descriptive term&lt;br&gt;
dd is a descriptive description for descriptive term&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;table&amp;gt;
                        &amp;lt;thead&amp;gt;
                            &amp;lt;caption&amp;gt;Table Title&amp;lt;/caption&amp;gt;
                            &amp;lt;tr&amp;gt;
                                &amp;lt;th&amp;gt;title1&amp;lt;/th&amp;gt;
                                &amp;lt;th&amp;gt;title2&amp;lt;/th&amp;gt;
                                &amp;lt;th&amp;gt;title3&amp;lt;/th&amp;gt;
                            &amp;lt;/tr&amp;gt;
                        &amp;lt;/thead&amp;gt;
                        &amp;lt;tbody&amp;gt;
                            &amp;lt;tr&amp;gt;
                                &amp;lt;td&amp;gt;item1&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item2&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item3&amp;lt;/td&amp;gt;
                            &amp;lt;/tr&amp;gt;
                            &amp;lt;tr&amp;gt;
                                &amp;lt;td colspan="2"&amp;gt;item1&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item2&amp;lt;/td&amp;gt;
                                &amp;lt;td&amp;gt;item3&amp;lt;/td&amp;gt;
                            &amp;lt;/tr&amp;gt;
                        &amp;lt;/tbody&amp;gt;
                    &amp;lt;/table&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;br&gt;
note: will be explained&lt;/p&gt;

&lt;p&gt;Let me know if there is something I missed.&lt;/p&gt;

&lt;p&gt;Resources:&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@pankajpatel?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Pankaj Patel&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/html?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>css</category>
    </item>
    <item>
      <title>Simple Calculator App in React </title>
      <dc:creator>Akshay R</dc:creator>
      <pubDate>Thu, 22 Jul 2021 18:23:59 +0000</pubDate>
      <link>https://dev.to/akshayrak/simple-calculator-app-in-react-118o</link>
      <guid>https://dev.to/akshayrak/simple-calculator-app-in-react-118o</guid>
      <description>&lt;p&gt;Simple Calculator is the best way to build a good understanding of react concepts. Let me know if there is any best way in which the same code can be implemented&lt;br&gt;
So please do comment on what you think.&lt;/p&gt;

&lt;p&gt;Following are the links to source code:&lt;br&gt;
GitHub: &lt;a href="https://github.com/akshayrak/react-simpl-calculator1234.git" rel="noopener noreferrer"&gt;https://github.com/akshayrak/react-simpl-calculator1234.git&lt;/a&gt;&lt;br&gt;
StackBlitz: &lt;a href="https://stackblitz.com/edit/react-simpl-calculator1234?file=src/App.js" rel="noopener noreferrer"&gt;https://stackblitz.com/edit/react-simpl-calculator1234?file=src/App.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Application link: &lt;a href="https://react-simpl-calculator1234.stackblitz.io" rel="noopener noreferrer"&gt;https://react-simpl-calculator1234.stackblitz.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have started it by creating a simple form&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;form&amp;gt;
        &amp;lt;input
          type="text"
          onChange={e =&amp;gt; setInput(e.target.value)}
          value={input} 
         /&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can use useState hook to maintain the state of the form&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [input, setInput] = useState("0")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default value will be zero&lt;/p&gt;

&lt;p&gt;For the buttons we can create a variable and put all the symbols in an 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 symbols = [
    'c',
    '&amp;lt;-',
    '%',
    '/',
    '7',
    '8',
    '9',
    'X',
    '4',
    '5',
    '6',
    '-',
    '1',
    '2',
    '3',
    '+',
    '.',
    '0',
    '='
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so now we can use 'map' method in js to loop through all the elements and return a array of button elements&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&amp;gt;
        {symbols.map((symbol, i) =&amp;gt; (
          &amp;lt;button key={i} onClick={()=&amp;gt;handleSymbol(symbol)}&amp;gt;
            {symbol}
          &amp;lt;/button&amp;gt;
        ))}
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point it should look somewhat like this&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%2Fuploads%2Farticles%2F8nn5hvppzd4937l6ctlc.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%2Fuploads%2Farticles%2F8nn5hvppzd4937l6ctlc.png" alt="image of the simple calculator application till now"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is all the UI we want, now we can implement the logic for calculations.&lt;/p&gt;

&lt;p&gt;whenever a button is clicked "handleSymbol" method is triggered and the respective "symbol" is passed as an argument. Now we need to check what that symbol is and what should we do with it.&lt;/p&gt;

&lt;p&gt;So here I am using "input" state for maintaining the state of the form and also displaying the result in the same TextField. so we just need to set the final answer to "input".&lt;/p&gt;

&lt;p&gt;Now to get the answer we need to do few checks,&lt;br&gt;
check1: whether to Concatenate or to backspace or to delete or to calculate&lt;br&gt;
This can be done simply using if else statements&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (symbol != 'c' &amp;amp;&amp;amp; symbol != '&amp;lt;-' &amp;amp;&amp;amp; symbol != '=') {
//concatenate
}else if(symbol == 'c') {
//delete
} else if (symbol == '&amp;lt;-' &amp;amp;&amp;amp; input != '0'&amp;amp;&amp;amp;input!='') {
//backspace
} else if (symbol == '=') {
//calculate
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if it is Concatenate than we need to check what it is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (symbol == '.') {
        let temp = input.match(/[\d\.]+|\D+/g);//separate the string and the integer
        temp==null?temp=["0"]:null  //sets 0 if temp is null

         //checks whether dot exists or not in the last element (we can't have two dots in the same number)
        if (!temp[temp.length - 1].includes('.')) {
        //checks whether dot is typed after a symbol
          if (temp[temp.length - 1] == '+' ||
          temp[temp.length - 1] == '-' ||
          temp[temp.length - 1] == 'X' ||
          temp[temp.length - 1] == '/' ||
          temp[temp.length - 1] == '%') {
            //if it is typed after a symbol than it adds '0.' (so that it looks like a number)
            setInput(prev =&amp;gt; prev + '0.')
        }
          else {
            setInput(prev =&amp;gt; prev + symbol)
          }
        }
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if its not a don't and if its some thing else than&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;else{
 let temp = input.match(/[^\d]+|\d+/g);//separate the string and the integer
        temp==null?temp=["0"]:null //sets 0 if temp is null

        //these two if blocks checks whether the previously typed and current typed are operators (you can't put two operators next to each other)
        if (
          temp[temp.length - 1] == '+' ||
          temp[temp.length - 1] == '-' ||
          temp[temp.length - 1] == 'X' ||
          temp[temp.length - 1] == '/' ||
          temp[temp.length - 1] == '%'
        ) {
          //checks whether its a symbol or number
          if (
            symbol == '+' ||
            symbol == '-' ||
            symbol == 'X' ||
            symbol == '/' ||
            symbol == '%'
          ) {
            //if symbol than remove the previous one and concatenate the new one
            setInput(prev =&amp;gt; prev.slice(0, -1));
            setInput(prev =&amp;gt; prev + symbol);
          } else {
           //if number than concatenate
            setInput(prev =&amp;gt; prev + symbol);
          }
        } else {
         //if previous one is a number than concatenate the current one too
          setInput(prev =&amp;gt; prev + symbol);
        }
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now if its a backspace or a delete than its simple&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; else if (symbol == 'c') {
      setInput('0');
    } else if (symbol == '&amp;lt;-' &amp;amp;&amp;amp; input != '0'&amp;amp;&amp;amp;input!='') {
      setInput(prev =&amp;gt; prev.slice(0, -1));
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if its an equals symbol than we need to calculate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;else if (symbol == '=') {
     let temp = input.match(/[^\d]+|\d+/g);//separate the string and the integer
        temp==null?temp=["0"]:null //sets 0 if temp is null

//checks if the late typed character is a operator
      if (
        temp[temp.length - 1] == '+' ||
        temp[temp.length - 1] == '-' ||
        temp[temp.length - 1] == '/' ||
        temp[temp.length - 1] == 'X'
      ) {
//if its a operator than remove
        temp.pop();
      }

//Now we are using simple BODMAS rule to calculate


//if % exists than divide the number by 100 and multiply with the following number
      while (temp.includes('%')) {
        const index = temp.indexOf('%');
        const num1 = parseFloat(temp[index - 1]);
        let tempResult = (num1 / 100).toFixed(2).toString();
        temp.splice(index, 1, 'X');
        temp.splice(index - 1, 1, tempResult);
      }

//if '/' exists than divide the two numbers and remove them and replace the result
      while (temp.includes('/')) {
        const index = temp.indexOf('/');
        const num1 = parseFloat(temp[index - 1]);
        const num2 = parseFloat(temp[index + 1]);
        const tempResult = (num1 / num2).toFixed(2).toString();
        temp.splice(index, 1);
        temp.splice(index, 1);
        temp.splice(index - 1, 1, tempResult);
      }

//if 'X' exists than multiply the two numbers and remove them and replace the result
      while (temp.includes('X')) {
        const index = temp.indexOf('X');
        const num1 = parseFloat(temp[index - 1]);
        const num2 = parseFloat(temp[index + 1]);
        let tempResult = (num1 * num2).toFixed(2).toString();
        temp.splice(index, 1);
        temp.splice(index, 1);
        temp.splice(index - 1, 1, tempResult);
      }


//if '+' exists than add the two numbers and remove them and replace the result
      while (temp.includes('+')) {
        const index = temp.indexOf('+');
        const num1 = parseFloat(temp[index - 1]);
        const num2 = parseFloat(temp[index + 1]);
        let tempResult = (num1 + num2).toFixed(2).toString();
        temp.splice(index, 1);
        temp.splice(index, 1);
        temp.splice(index - 1, 1, tempResult);
      }

//if '-' exists than subtract the two numbers and remove them and replace the result
      while (temp.includes('-')) {
        const index = temp.indexOf('-');
        const num1 = parseFloat(temp[index - 1]);
        const num2 = parseFloat(temp[index + 1]);
        let tempResult = (num1 - num2).toFixed(2).toString();
        temp.splice(index, 1);
        temp.splice(index, 1);
        temp.splice(index - 1, 1, tempResult);
      }

//result can be set to input so that we can show it in the same textBox in which we type
      setInput(temp[0]);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have included most of the explanation as comments, so in case if you don't understand let me know.&lt;/p&gt;

&lt;p&gt;And if you can make it better let me know as well.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br&gt;
Akshay&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>ToDo List App for Beginners in React</title>
      <dc:creator>Akshay R</dc:creator>
      <pubDate>Mon, 19 Jul 2021 17:29:50 +0000</pubDate>
      <link>https://dev.to/akshayrak/todo-list-app-for-starters-in-react-5eka</link>
      <guid>https://dev.to/akshayrak/todo-list-app-for-starters-in-react-5eka</guid>
      <description>&lt;p&gt;Todo list is a simple list of things that you might want to do, basically which can be written on a piece of paper. ToDo list app is really good and simple way to understand the fundamentals of React.&lt;/p&gt;

&lt;p&gt;In this post let's see how it is done, before that these are the links of source code and app on StackBlitz.&lt;/p&gt;

&lt;p&gt;GitHub link: &lt;a href="https://github.com/akshayrak/react-todo-app.git"&gt;https://github.com/akshayrak/react-todo-app.git&lt;/a&gt;&lt;br&gt;
StackBlitz codeLink: &lt;a href="https://stackblitz.com/edit/react-todo-app-1234?file=src/components/todo.js"&gt;https://stackblitz.com/edit/react-todo-app-1234?file=src/components/todo.js&lt;/a&gt;&lt;br&gt;
Application link: &lt;a href="https://react-todo-app-1234.stackblitz.io/?inputTodo=hello"&gt;https://react-todo-app-1234.stackblitz.io/?inputTodo=hello&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

const Todo = () =&amp;gt; {

  const [input, setInput] = useState();
  const [items, setItems] = useState([]);

  const addHandler = e =&amp;gt; {
    e.preventDefault();
    if(input){
      setItems([...items,input]);
      setInput('')
    }
  }

  const deleteHandler = (ele) =&amp;gt;{
    setItems(items.filter((x)=&amp;gt;x!==ele))
  }

  return (
    &amp;lt;div&amp;gt;

      &amp;lt;form onSubmit={addHandler}&amp;gt;
        &amp;lt;input
          type="text"
          id="inputTodo"
          name="inputTodo"
          placeholder="type a task"
          onChange={(e) =&amp;gt; setInput(e.target.value)}
          value={input}
        /&amp;gt;
        &amp;lt;button type="submit"&amp;gt;Add&amp;lt;/button&amp;gt;
      &amp;lt;/form&amp;gt;

      &amp;lt;div&amp;gt;
        {items.map((ele, i) =&amp;gt; {
          return (
            &amp;lt;div key={i}&amp;gt;{ele}
             &amp;lt;button onClick={()=&amp;gt;deleteHandler(ele)}&amp;gt;X&amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;
        )})}
      &amp;lt;/div&amp;gt;

    &amp;lt;/div&amp;gt;
  );
};
export default Todo;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We start it with importing React and useState hook, and create a functional component.&lt;/p&gt;

&lt;p&gt;For taking input create a small form with a submit button&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;form onSubmit={addHandler}&amp;gt;
        &amp;lt;input
          type="text"
          id="inputTodo"
          name="inputTodo"
          placeholder="type a task"
          onChange={(e) =&amp;gt; setInput(e.target.value)}
          value={input}
        /&amp;gt;
        &amp;lt;button type="submit"&amp;gt;Add&amp;lt;/button&amp;gt;
      &amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we create input state for holding the single todo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [input, setInput] = useState();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and items for holding the entire todo list&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [items, setItems] = useState([]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so in the form we assign input to value attribute and set the onChange event to setInput() using event.target.value&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onChange={(e) =&amp;gt; setInput(e.target.value)}
value={input}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when ever the form is submitted we submit it to addHandler method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onSubmit={addHandler}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the addHandler method we check whether something is typed or not so that we don't create empty items, since we have assigned the value of the input tag to 'input' state we can do this check.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const addHandler = e =&amp;gt; {
    e.preventDefault();
    if(input){
      setItems([...items,input]);//spreed operator for existing items
      setInput('')//set the input to empty string, so that input box is empty after adding the item
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we create some more code for displaying and deleting the items with the help of map method&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&amp;gt;
        {items.map((ele, i) =&amp;gt; {
          return (
            &amp;lt;div key={i}&amp;gt;{ele}
             &amp;lt;button onClick={()=&amp;gt;deleteHandler(ele)}&amp;gt;X&amp;lt;/button&amp;gt;
            &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;Once we click the delete button it triggers the deleteHandler function by passing the element as parameter in which we delete the item just by filtering out the sent element and setting the remaining items to setItem()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const deleteHandler = (ele) =&amp;gt;{
    setItems(items.filter((x)=&amp;gt;x!==ele))
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the complete app, let me know if there is any better way to implement the same.&lt;/p&gt;

&lt;p&gt;Image used in this post is a Photo by &lt;a href="https://unsplash.com/@glenncarstenspeters?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Glenn Carstens-Peters&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/todo?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
