<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saurabh Maurya on Medium]]></title>
        <description><![CDATA[Stories by Saurabh Maurya on Medium]]></description>
        <link>https://medium.com/@saurabhmaurya45?source=rss-2b48c8266ad7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*577N1DZMj8OOOnQJPA4lJA.png</url>
            <title>Stories by Saurabh Maurya on Medium</title>
            <link>https://medium.com/@saurabhmaurya45?source=rss-2b48c8266ad7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:07:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saurabhmaurya45/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Errors in JavaScript]]></title>
            <link>https://medium.com/@saurabhmaurya45/errors-in-javascript-0dd0a093e4ea?source=rss-2b48c8266ad7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dd0a093e4ea</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Saurabh Maurya]]></dc:creator>
            <pubDate>Sun, 07 Jan 2024 21:45:51 GMT</pubDate>
            <atom:updated>2024-01-07T21:45:51.715Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding errors raised by any programming language is very important. Knowing the reason behind the error helps in debugging and solving errors quickly.</p><p>So Let’s deep dive a little into errors in JavaScript.</p><p>Let us first understand what is error?</p><h4><strong>Error</strong></h4><p><em>Any unwanted, undesirable event that disrupts the normal flow of execution is known as error.</em></p><p>JavaScript code can encounter different errors when it is executed. Errors can be caused by programming mistakes, incorrect input, or other unforeseeable events.</p><p>There are 3 types of error:</p><ul><li>Syntax error</li><li>Logical error</li><li>Runtime error</li></ul><p><strong><em>Syntax Error: This error arises due to programmer during writing the code.It is also a compile time error.</em></strong></p><pre>while{<br>  console.log(&quot;Hello&quot;);<br>}<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywOl2Fi0Rqndf6LUi-GC_Q.png" /></figure><p>Here we are trying to access the function which is not present.</p><p><strong><em>Logical Error: Error due to our defined logic.</em></strong></p><p>For example : We are writing while loop and we forget to give the terminating condition;</p><pre>let count = 1;<br>while(count&lt;10){<br>  console.log(&quot;Hello&quot;);<br>}</pre><p>Here we forget to increment the count value. Due to this the loop will execute infinite times.</p><p><strong><em>Runtime Error: Error occurs during execution of the program. It is also known as exception.</em></strong></p><pre>&lt;script type=&quot;text/javascript&quot;&gt;<br>    window.printme(); // print<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*37iM9F4ie_qP1o1kFr7dmQ.png" /></figure><p>Here, it is trying to call a method that does not exist.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dd0a093e4ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The work of tags like <b>,<i>,<em> can be done with CSS. Then why are these tags there in HTML5?]]></title>
            <link>https://medium.com/@saurabhmaurya45/the-work-of-tags-like-b-i-em-can-be-done-with-css-then-why-are-these-tags-there-in-html5-9bec3b33d857?source=rss-2b48c8266ad7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bec3b33d857</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[css3]]></category>
            <category><![CDATA[html5]]></category>
            <dc:creator><![CDATA[Saurabh Maurya]]></dc:creator>
            <pubDate>Mon, 18 Dec 2023 11:32:24 GMT</pubDate>
            <atom:updated>2023-12-18T11:32:24.428Z</atom:updated>
            <content:encoded><![CDATA[<p>Before going into the exact reason let us assume a situation suppose that you are Working on a very big project let’s say an ERP system. In projects like ERP, everything used to be dynamic. There is nearly no static content.</p><p>Now let us suppose that you have to show some paragraphs with some specific words in <em>italics</em> and some in <strong>bold</strong>. The data has to come from the back-end i.e. from the database.</p><p>So at the front-end level, it is difficult to handle this situation with HTML and CSS. This means it is difficult to put a span tag for each special word and write CSS for making bold and italic. This creates a problem.</p><p>The solution is:<br>We send the data by putting those <em>&lt;b&gt;</em> or <em>&lt;i&gt;</em> tags from the back-end itself wherever required. This will solve our problem and we need not worry at the front-end level.</p><p>Now doubt may arise about if we can embed these HTML tags in between paragraphs wherever required. Then we can also embed <em>&lt;span&gt;</em> tag with some class and CSS and can send it as we were sending the HTML code.</p><p>Yes, we can do that thing also. But in some situations, this could cause problems.</p><p>Let us suppose that we are making an Ajax call that will accept that generated paragraph.</p><p>The syntax format of CSS is <br>selector{<br> property: value;<br>}</p><p>Now let’s understand it with an example:</p><p>Let the string generated at the back end with CSS be like :<br>htmlString = ‘<br> <strong><em>&lt;style&gt;<br> .bold{<br> font-weight: bold;<br> }<br> .italic{<br> font-style: italic;<br> }<br> &lt;/style&gt;<br> &lt;p&gt;This is the &lt;span class = “italic” &gt;generated&lt;/span&gt; string with special &lt;span class = “bold”&gt; property&lt;/span&gt;.&lt;/p&gt;</em></strong><br> ‘</p><p>Now this content will be received at the front-end side in any variable after the Ajax call.</p><p>The Curly braces present there might break the code and close the block before it is required. Because the JavaScript function or block also starts with <em>‘{‘ </em>and ends with ‘<em>}’</em>.</p><p>And if we are sending only HTML we will not face these type of issue because the syntax doesn’t matches with any programming language used nowadays.</p><p>Hence, this is the reason why the tags like <em>&lt;b&gt;, &lt;i&gt;, &lt;em&gt;</em> etc. still exist in html5 also.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bec3b33d857" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let & Const with temporal dead zone]]></title>
            <link>https://medium.com/@saurabhmaurya45/let-const-with-temporal-dead-zone-7e0e7e0cf196?source=rss-2b48c8266ad7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e0e7e0cf196</guid>
            <category><![CDATA[let-const-var]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Saurabh Maurya]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 12:07:36 GMT</pubDate>
            <atom:updated>2022-10-01T06:30:32.456Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Let and Const are hoisted?</strong></p><p><strong>Yes</strong>, but it behaves differently. It doesn’t act as var behaves.</p><p>Eg:</p><p>let a = 10;</p><p>console.log (a);</p><p>var b = 100;</p><p>In the case of var even before the first line of code is executed, JavaScript declares the memory space for the variable in the global space and initializes it with undefined. We can access it before even declaring it.</p><p>But, in the case of let, it happens differently. It is also hoisted but in a separate memory space called <strong>Temporal Dead Zone.</strong> And it cannot be accessed as like a variable declared with a var keyword before declaring it.</p><h3><strong>Temporal Dead Zone</strong></h3><p>It is the time when the let variable was hosted and not initialized. This phase is known as Temporal Dead Zone. When we try to access a variable inside a temporal dead zone it gives <strong>ReferenceError:</strong> Cannot access &lt;’variable_name’&gt; before initialization. This means the value can only be accessed after initializing it.</p><p><strong>No redeclaration of the let </strong>keyword is allowed. If we try to do so, it will give <strong>SyntaxError:</strong> Identifier &lt;’variable_name’&gt; has already been declared.</p><p><strong>Const </strong>is a little stricter than let. It signifies content value so it doesn’t allow redeclaration of value. It is initialized during the declaration.</p><h3><strong>Note:</strong></h3><p><strong>ReferenceError</strong> arises when we try to access illegal memory i.e variables that are not in the memory or they are in a temporal dead zone.</p><p><strong>TypeError </strong>arises if we did some mistake regarding behavior means for example if we try to redeclare the const variable.</p><p><strong>SyntaxError </strong>arises if we do some mistake in writing the syntax.</p><h3><strong>Block Scope</strong></h3><p><strong>Block: </strong>Block is also known as a compound statement. It is used to combine multiple statements into a group. We need to group these statements because it helps us to use multiple statements where JavaScript expects a single statement. {Code inside these curly braces is in one block}</p><p>This means we group multiple statements to use where JavaScript expects single statements.</p><p>Eg: if(true) true; //single statement</p><p>But if we want to execute multiple statements then we need to use block.</p><p>This means that all variable and function we can access inside a block comes under a block known as the scope of the block.</p><p>Var is not block scoped it is only global and function scope.</p><p>Let and const is block scoped with the global and function.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e0e7e0cf196" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FLEXBOX IN CSS]]></title>
            <link>https://medium.com/@saurabhmaurya45/flexbox-in-css-fa0a4b2245c0?source=rss-2b48c8266ad7------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa0a4b2245c0</guid>
            <category><![CDATA[flex]]></category>
            <category><![CDATA[css3]]></category>
            <category><![CDATA[flexbox]]></category>
            <dc:creator><![CDATA[Saurabh Maurya]]></dc:creator>
            <pubDate>Thu, 22 Sep 2022 18:16:58 GMT</pubDate>
            <atom:updated>2022-09-22T18:16:58.868Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Flexbox:</strong> Flexible box(flexbox) is a layout model for one-dimensional content that easily arranges items within a container. Flexbox can be helpful for creating small-scale layouts &amp; is responsive and mobile-friendly.</p><p>Before the flexbox model, we had 4 layout modes:</p><ul><li><strong>Block:</strong> It is used to make sections in web pages.</li><li><strong>Inline:</strong> It is used for text.</li><li><strong>Table:</strong> It is used for two-dimensional table data.</li><li><strong>Positioned:</strong> It is used for the explicit position of an element.</li></ul><p><strong>Why use flexbox:</strong></p><ul><li>A lot of flexibility is given.</li><li>Arrangement &amp; alignment of items.</li><li>Proper spacing</li><li>Order &amp; Sequencing of items.</li><li>Bootstrap 4 is built on top of the flex layout.</li></ul><p><strong>Start using Flexbox</strong></p><p>To start using the flexbox model we define a flex container.</p><p>For example:</p><p><em>&lt;div class=”flex-container”&gt;<br> &lt;div&gt;1&lt;/div&gt;<br> &lt;div&gt;2&lt;/div&gt;<br> &lt;div&gt;3&lt;/div&gt;<br>&lt;/div&gt;</em></p><p>And CSS for the same is</p><p><em>&lt;style&gt;<br>.flex-container {<br> display: flex;<br> background-color: DodgerBlue;<br>}</em></p><p><em>.flex-container &gt; div {<br> background-color: #f1f1f1;<br> margin: 10px;<br> padding: 20px;<br> font-size: 30px;<br>}</em></p><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*0xKsU5Si4N2fgsBN2YMnvQ.png" /></figure><p>In the above HTML code, div with class =”flex-container” is the parent container/main-container with 3 child container.</p><p>The flex container becomes flexible by setting the display property to flex.</p><p>The flex container properties are:</p><ul><li>flex-direction</li><li><a href="https://www.w3schools.com/css/css3_flexbox_container.asp#flex-wrap">f</a>lex-wrap</li><li><a href="https://www.w3schools.com/css/css3_flexbox_container.asp#flex-flow">f</a>lex-flow</li><li><a href="https://www.w3schools.com/css/css3_flexbox_container.asp#justify-content">j</a>ustify-content</li><li><a href="https://www.w3schools.com/css/css3_flexbox_container.asp#align-items">a</a>lign-items</li><li><a href="https://www.w3schools.com/css/css3_flexbox_container.asp#align-content">a</a>lign-content</li></ul><h4><strong><em>flex-direction</em></strong><em>:</em></h4><p>Defines in which direction the container wants to stack the flex items.</p><p>Allowed values:</p><p><strong>row</strong>: flex items horizontally (from left to right)</p><p><strong>row-reverse</strong>: flex items horizontally (from right to left)</p><p><strong>column</strong>: flex items vertically (but from top to bottom)</p><p><strong>column-reverse</strong>: flex items vertically (but from bottom to top)</p><h4>flex-wrap:</h4><p>It specifies whether the flex items should wrap or not.</p><p>Allowed values:</p><p><strong>wrap: </strong>specifies that the flex items will wrap if necessary</p><p><strong>nowrap:</strong> specifies that the flex items will not wrap (this is the default)</p><p><strong>wrap-reverse: </strong>specifies that the flexible items will wrap if necessary, in reverse order</p><h4>flex-flow:</h4><p>It is a shorthand property for setting both the flex-direction and flex-wrap properties.</p><p>Ex: flex-flow: row wrap;</p><h4>justify-content:</h4><p>Used to align the flex item</p><p>Allowed values:</p><p><strong>center: </strong>aligns the flex items at the center of the container.</p><p><strong>flex-start: </strong>aligns the flex items at the beginning of the container (this is the default)</p><p><strong>flex-end:</strong> aligns the flex items at the end of the container.</p><p><strong>space-around: </strong>displays the flex items with space before, between, and after the lines.</p><p><strong>space-between: </strong>displays the flex items with space between the lines.</p><h4>align-content:</h4><p>Used to align the flex lines.</p><p>Allowed values:</p><p><strong>center: </strong>display the flex lines in the middle of the container.</p><p><strong>flex-start: </strong>displays the flex lines at the start of the container.</p><p><strong>flex-end:</strong> displays the flex lines at the end of the container.</p><p><strong>space-around: </strong>displays the flex lines with space before, between, and after them.</p><p><strong>space-between: </strong>displays the flex lines with equal space between them.</p><p><strong>stretch: </strong>stretches the flex lines to take up the remaining space (this is the default).</p><h4>align-items:</h4><p>Used to align the flex items.</p><p>Allowed values:</p><p><strong>center: </strong>display the flex items in the middle of the container.</p><p><strong>flex-start: </strong>displays the flex items at the top of the container.</p><p><strong>flex-end:</strong> displays the flex items at the bottom of the container.</p><p><strong>stretch: </strong>stretches the flex items to fill the container (this is the default).</p><p><strong>baseline:</strong> aligns the flex items such as their baselines aligns</p><p>The flex item properties are:</p><ul><li><strong>order</strong> : specifies the order of the flex items</li><li><strong>flex-grow </strong>: specifies how much a flex item will grow relative to the rest of the flex items</li><li><strong>flex-shrink </strong>: specifies how much a flex item will shrink relative to the rest of the flex items</li><li><strong>flex-basis </strong>: property specifies the initial length of a flex item</li><li><strong>flex </strong>: shorthand property for the flex-grow, flex-shrink, and flex-basis properties(in the same order as specified)</li><li><strong>align-self </strong>: specifies the alignment for the selected item inside the flexible container</li></ul><p><strong>NOTE: </strong>Use a media query(<em>@media()</em>) to create a responsive flex design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa0a4b2245c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>