<?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: Ramkumar.barani</title>
    <description>The latest articles on DEV Community by Ramkumar.barani (@ramk777stack).</description>
    <link>https://dev.to/ramk777stack</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%2F652417%2F3d02e457-2163-4d86-98c8-34fb7fa1609e.jpg</url>
      <title>DEV Community: Ramkumar.barani</title>
      <link>https://dev.to/ramk777stack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ramk777stack"/>
    <language>en</language>
    <item>
      <title>Understanding Loops in JavaScript</title>
      <dc:creator>Ramkumar.barani</dc:creator>
      <pubDate>Mon, 03 Mar 2025 09:20:25 +0000</pubDate>
      <link>https://dev.to/ramk777stack/understanding-loops-in-javascript-1n3p</link>
      <guid>https://dev.to/ramk777stack/understanding-loops-in-javascript-1n3p</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Loops are fundamental in JavaScript, allowing us to execute code repeatedly and iterate through data structures like arrays and objects. In this guide, we'll explore different types of loops, their use cases, and best practices to optimize your code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Different Ways to Create a Loop in JavaScript
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;for&lt;/code&gt; Loop
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;for&lt;/code&gt; loop is one of the most commonly used loops, giving you full control over iteration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax &amp;amp; Explanation:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Outputs 0 to 4&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;let i = 0;&lt;/code&gt; → Initializes the loop counter.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;i &amp;lt; 5;&lt;/code&gt; → The loop runs while this condition is &lt;code&gt;true&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;i++&lt;/code&gt; → Increments the counter after each iteration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Use:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When the number of iterations is known.&lt;/li&gt;
&lt;li&gt;When precise control over each step is required.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;code&gt;while&lt;/code&gt; Loop
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;while&lt;/code&gt; loop executes as long as its condition remains &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax &amp;amp; Explanation:
&lt;/h3&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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&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;ul&gt;
&lt;li&gt;The condition &lt;code&gt;i &amp;lt; 5&lt;/code&gt; is checked before each iteration.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;true&lt;/code&gt;, the loop executes; otherwise, it stops.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;i++&lt;/code&gt; ensures the loop does not run indefinitely.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Be Careful: Infinite Loops
&lt;/h3&gt;

&lt;p&gt;An infinite loop occurs if the condition never becomes &lt;code&gt;false&lt;/code&gt;:&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="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This will run forever!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Stops the loop&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  When to Use:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When the number of iterations is unknown.&lt;/li&gt;
&lt;li&gt;When looping depends on a condition instead of a fixed counter.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;forEach&lt;/code&gt; (For Arrays)
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;forEach&lt;/code&gt; provides a concise way to iterate over arrays.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax:
&lt;/h3&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;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  When to Use:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When iterating through an array without modifying it.&lt;/li&gt;
&lt;li&gt;When you do not need to exit the loop early (&lt;code&gt;forEach&lt;/code&gt; does not support &lt;code&gt;break&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Modern Ways to Loop
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;.map()&lt;/code&gt; – Transforming Data
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;.map()&lt;/code&gt; creates a new array by applying a function to each element.&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;doubled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;doubled&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// [2, 4, 6, 8, 10]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;.map()&lt;/code&gt; when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need a new array with modified values.&lt;/li&gt;
&lt;li&gt;The main difference between &lt;code&gt;forEach&lt;/code&gt; and &lt;code&gt;map&lt;/code&gt; is that &lt;code&gt;map&lt;/code&gt; returns a new array, whereas &lt;code&gt;forEach&lt;/code&gt; does not.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;.filter()&lt;/code&gt; – Filtering Data
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;.filter()&lt;/code&gt; returns a new array containing elements that meet a condition.&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;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&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;greaterThanFive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;greaterThanFive&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// [7, 9, 6, 8]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;.filter()&lt;/code&gt; when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need to extract specific elements from an array.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Looping Through Objects
&lt;/h2&gt;

&lt;p&gt;Objects are not directly iterable like arrays, but you can use &lt;code&gt;for...in&lt;/code&gt;, &lt;code&gt;Object.keys()&lt;/code&gt;, &lt;code&gt;Object.values()&lt;/code&gt;, or &lt;code&gt;Object.entries()&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;for...in&lt;/code&gt;
&lt;/h3&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;user&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;John&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;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;job&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Developer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;for &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;key&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;user&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&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;h3&gt;
  
  
  &lt;code&gt;Object.entries()&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(([&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;Use these when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Working with objects instead of arrays.&lt;/li&gt;
&lt;li&gt;Efficiently iterating through properties.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Traditional vs. Modern Approaches
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example 1: Filtering &amp;amp; Transforming Data
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Traditional Approach: Using a &lt;code&gt;for&lt;/code&gt; Loop&lt;/strong&gt;
&lt;/h3&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;activeUsers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="k"&gt;for &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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;activeUsers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&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="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&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;span class="na"&gt;lastLogin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;lastLogin&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Modern Approach: Using &lt;code&gt;.filter()&lt;/code&gt; &amp;amp; &lt;code&gt;.map()&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&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;activeUsers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="nx"&gt;user&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;span class="na"&gt;lastLogin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lastLogin&lt;/span&gt;
    &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2: Doubling Even Numbers
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Traditional Approach: Using a &lt;code&gt;for&lt;/code&gt; Loop&lt;/strong&gt;
&lt;/h3&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;doubledEvens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="k"&gt;for &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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;doubledEvens&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Modern Approach: Using &lt;code&gt;.filter()&lt;/code&gt; &amp;amp; &lt;code&gt;.map()&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&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;doubledEvens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Best &amp;amp; Bad Practices
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Best Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;.map()&lt;/code&gt; and &lt;code&gt;.filter()&lt;/code&gt; for cleaner transformations.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;for...of&lt;/code&gt; for better readability when looping over arrays.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;Object.entries()&lt;/code&gt; for efficient object iteration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ❌ Bad Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Avoid modifying arrays directly inside loops.&lt;/li&gt;
&lt;li&gt;Avoid &lt;code&gt;for...in&lt;/code&gt; for arrays (it iterates over properties, not values).&lt;/li&gt;
&lt;li&gt;Be cautious with infinite loops (&lt;code&gt;while (true) {}&lt;/code&gt; without &lt;code&gt;break&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;for&lt;/code&gt; loops are generally the fastest since they avoid function calls.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, and &lt;code&gt;forEach&lt;/code&gt; are more readable but slightly slower.&lt;/li&gt;
&lt;li&gt;For large datasets, use &lt;code&gt;for&lt;/code&gt; loops when performance is critical.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Loops are essential in JavaScript, and choosing the right one depends on the use case. Modern array methods like &lt;code&gt;.map()&lt;/code&gt; and &lt;code&gt;.filter()&lt;/code&gt; help write cleaner, more maintainable code. Understanding the trade-offs between readability and performance will make you a better JavaScript developer. Start experimenting with these techniques today! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>jslovers</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding Feature Flags: A Simple Guide</title>
      <dc:creator>Ramkumar.barani</dc:creator>
      <pubDate>Mon, 16 Sep 2024 14:08:09 +0000</pubDate>
      <link>https://dev.to/ramk777stack/understanding-feature-flags-a-simple-guide-4on6</link>
      <guid>https://dev.to/ramk777stack/understanding-feature-flags-a-simple-guide-4on6</guid>
      <description>&lt;p&gt;When building software, releasing new features quickly without breaking anything can be tricky. Feature flags make this easier. After reading about Vercel’s Feature Flag SDK, I thought it would be helpful to study more about feature flags and explain what they are, how they work, and how you can build one on your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Feature Flags?
&lt;/h2&gt;

&lt;p&gt;Feature flags (also called &lt;strong&gt;feature toggles&lt;/strong&gt;) allow developers to turn features on or off without needing to change the code or redeploy the application. This means you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Release features gradually&lt;/strong&gt;: Let only some users see the new feature and slowly roll it out to everyone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test new features in production&lt;/strong&gt;: You can enable the feature for yourself or a small group of testers without making it available to all users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quickly roll back a feature&lt;/strong&gt;: If a new feature causes issues, you can disable it without redeploying.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With feature flags, you control when users can access features, separate from when the code is deployed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Use Feature Flags?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Continuous Delivery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Feature flags help teams release code more frequently. You can merge unfinished work into the main codebase, hide it behind a flag, and deploy it without affecting users.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A/B Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can test two versions of a feature with different user groups to see which performs better. This helps improve the user experience based on real data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Controlled Rollouts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can release a feature to a small group of users, monitor its performance, and then release it to everyone else.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick Rollbacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If something goes wrong, turning off the feature flag is much faster than reverting code changes, helping to keep the app stable.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Using Feature Flags in Next.js with Vercel's Flags SDK
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;flags.ts (Server-side)&lt;/strong&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 { unstable_flag as flag } from "@vercel/flags/next";

export const showBanner = flag({
  key: "banner",
  decide: () =&amp;gt; false,
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;decide&lt;/code&gt; function determines the flag’s value, which can be provided from various sources such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment variables&lt;/li&gt;
&lt;li&gt;Other feature flag providers&lt;/li&gt;
&lt;li&gt;Vercel's Edge Config (data config store)&lt;/li&gt;
&lt;li&gt;Databases, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;app/page.tsx&lt;/strong&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 { showBanner } from "../flags";

export default async function Page() {
  const banner = await showBanner();
  return (
    &amp;lt;div&amp;gt;
      {banner ? &amp;lt;Banner /&amp;gt; : null}
      {/* other components */}
    &amp;lt;/div&amp;gt;
  );
}

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

&lt;/div&gt;



&lt;p&gt;Since the flags are functions, we can easily change the implementation without modifying anything on the calling side. This flexibility allows your application to adapt to new requirements without needing to alter the core structure of the flag logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build Your Own Feature Flag System
&lt;/h2&gt;

&lt;p&gt;Let’s build a simple feature flag system that you can improve over time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a Custom Hook for Retrieving Feature Flags
&lt;/h3&gt;

&lt;p&gt;This step involves creating a custom hook that will allow you to retrieve feature flags dynamically. You can easily reuse this hook in any part of your React application to check if a feature is enabled or disabled.&lt;br&gt;
&lt;/p&gt;

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

export const useFeatureFlag = (key: string): boolean =&amp;gt; {
  const [isEnabled, setIsEnabled] = useState&amp;lt;boolean&amp;gt;(false);

  useEffect(() =&amp;gt; {
    const fetchFeatureFlag = async () =&amp;gt; {
      try {
        const response = await fetch(`http://localhost:3001/api/feature-flags/${key}`);
        if (response.ok) {
          const data = await response.json();
          setIsEnabled(data.is_enabled);
        }
      } catch (error) {
        console.error('Failed to fetch feature flag:', error);
      }
    };

    fetchFeatureFlag();
  }, [key]);

  return isEnabled;
};

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: React Component
&lt;/h3&gt;

&lt;p&gt;Next, create a component that uses the custom hook to render different features based on whether the flag is enabled or disabled. This will allow your application to seamlessly switch between old and new functionality without any disruption to the user experience.&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 from 'react';
import { useFeatureFlag } from './useFeatureFlag';

const FeatureFlaggedComponent: React.FC = () =&amp;gt; {
  const isNewFeatureEnabled = useFeatureFlag('new-feature');

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Feature Flag Example&amp;lt;/h1&amp;gt;
      {isNewFeatureEnabled ? (
        &amp;lt;div&amp;gt;
          &amp;lt;h2&amp;gt;New Feature&amp;lt;/h2&amp;gt;
          &amp;lt;p&amp;gt;This is the new feature enabled by the feature flag.&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      ) : (
        &amp;lt;div&amp;gt;
          &amp;lt;h2&amp;gt;Old Feature&amp;lt;/h2&amp;gt;
          &amp;lt;p&amp;gt;This is the old feature displayed when the new feature is disabled.&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
      )}
    &amp;lt;/div&amp;gt;
  );
};

export default FeatureFlaggedComponent;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Other Feature Flag Solutions in the Market
&lt;/h3&gt;

&lt;p&gt;Building your own feature flag system is useful for small projects, but if you're working with larger teams or need more advanced control, several tools offer feature flagging as a service:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://vercel.com/blog/flags-as-code-in-next-js" rel="noopener noreferrer"&gt;&lt;strong&gt;Vercel Feature Flags&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vercel offers feature flags integrated with their platform, allowing real-time control over which users see which features.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://launchdarkly.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;LaunchDarkly&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LaunchDarkly is a popular tool for managing feature flags at scale. It supports complex rollouts, targeting users based on attributes like location or behavior.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.optimizely.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Optimizely&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Optimizely focuses on experimentation and A/B testing, using feature flags to test different features and improve user experience.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.split.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;Split.io&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Split.io allows teams to divide traffic between different feature versions and track performance metrics in real-time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.hypertune.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Hypertune&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hypertune is a newer player in the feature flagging space, focusing on high-performance experimentation and feature toggling. It enables teams to run complex experiments with minimal latency, ensuring real-time performance insights. Hypertune's unique approach integrates feature flags with machine learning models, allowing for more intelligent decision-making in terms of feature rollouts and user targeting.&lt;/p&gt;

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

&lt;p&gt;Feature flags are an excellent way to release features safely, test in production, and make quick changes without redeploying code. You can build a simple feature flag system using JavaScript or use more advanced tools like Vercel, LaunchDarkly, or Optimizely for larger projects.&lt;/p&gt;

&lt;p&gt;Using feature flags will make your development process more flexible and efficient, allowing you to deliver new features faster and more confidently.&lt;/p&gt;

&lt;p&gt;Thanks for reading, and please feel free to share your comments!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Understanding Flex Properties in CSS</title>
      <dc:creator>Ramkumar.barani</dc:creator>
      <pubDate>Wed, 11 Sep 2024 10:51:50 +0000</pubDate>
      <link>https://dev.to/ramk777stack/understanding-flex-properties-in-css-39ek</link>
      <guid>https://dev.to/ramk777stack/understanding-flex-properties-in-css-39ek</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Designing a website is like creating art. Just as a painting’s arrangement tells a story, a website's layout speaks more about its message. Flexbox is a powerful tool for achieving this. &lt;/p&gt;

&lt;p&gt;Before Flexbox, developers had to use techniques like floating elements, margin hacks, and table layouts to create responsive designs. These methods worked but weren't scalable and required additional media queries to adjust for different screen sizes. &lt;/p&gt;

&lt;p&gt;Flexbox changed this by providing a simple, efficient way to align, distribute, and size elements within a container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Flexbox?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Flexbox is a layout model that helps you create complex layouts easily. It allows you to align items horizontally or vertically within a container. Flexbox is one-dimensional, meaning it controls the layout along a single axis (either horizontal or vertical) at a time.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Horizontal Alignment&lt;/strong&gt;: You can easily align items side by side in rows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vertical Alignment&lt;/strong&gt;: Aligning items in columns.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this blog, we'll dive into the key properties of Flexbox and how they simplify layout management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flex Container Properties:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving into flex properties, it's important to understand the two axes of Flexbox:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Main Axis&lt;/li&gt;
&lt;li&gt;Cross Axis&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Understanding these axes is important because some properties align items along the main axis, while others align them along the cross axis. Knowing this will help you better understand how the properties work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0dyf0vquhtf6y72ttyaj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0dyf0vquhtf6y72ttyaj.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;flex-direction&lt;/strong&gt;: row | column&lt;/p&gt;

&lt;p&gt;Flexbox is all about aligning items in rows or columns. By default, it's set to row.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;row&lt;/code&gt;&lt;/strong&gt;: Aligns items horizontally (default).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;column&lt;/code&gt;&lt;/strong&gt;: Aligns items vertically.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="display: flex; flex-direction: row;"&amp;gt;
  &amp;lt;div&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;flex-wrap:&lt;/strong&gt; nowrap | wrap | wrap-reverse&lt;/p&gt;

&lt;p&gt;It allows flex items to wrap into the next line instead of shrinking them. The default is nowrap.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;nowrap&lt;/code&gt;&lt;/strong&gt;: All flex items will be on one line (default).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wrap&lt;/code&gt;&lt;/strong&gt;: Flex items will wrap to the next line if they don’t fit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wrap-reverse&lt;/code&gt;&lt;/strong&gt;: Flex items will wrap in the reverse direction.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="display: flex; flex-wrap: wrap;"&amp;gt;
  &amp;lt;div class="box"&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div class="box"&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div class="box"&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;justify-content:&lt;/strong&gt; flex-start | flex-end | center | space-between | space-around | space-evenly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Used to align items along the main axis.&lt;/strong&gt; For flex-direction: row, the x-axis is the main axis and the y-axis is the cross axis.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;flex-start&lt;/code&gt;&lt;/strong&gt;: Aligns items to the start of the container.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;flex-end&lt;/code&gt;&lt;/strong&gt;: Aligns items to the end.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;center&lt;/code&gt;&lt;/strong&gt;: Centers items.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;space-between&lt;/code&gt;&lt;/strong&gt;: Distributes items with space between them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;space-around&lt;/code&gt;&lt;/strong&gt;: Distributes items with space around them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;space-evenly&lt;/code&gt;&lt;/strong&gt;: Evenly distributes space between items.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="display: flex; justify-content: space-between;"&amp;gt;
  &amp;lt;div&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;align-items:&lt;/strong&gt; flex-start | flex-end | center | stretch | baseline&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Used to align items along the cross axis.&lt;/strong&gt; For column flex-direction, the y-axis is the main axis and the x-axis is the cross axis.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;flex-start&lt;/code&gt;&lt;/strong&gt;: Aligns items to the start of the cross axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;flex-end&lt;/code&gt;&lt;/strong&gt;: Aligns items to the end.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;center&lt;/code&gt;&lt;/strong&gt;: Centers items on the cross axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;stretch&lt;/code&gt;&lt;/strong&gt;: Stretches items to fill the container.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;baseline&lt;/code&gt;&lt;/strong&gt;: Aligns items based on their text baseline.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div style="display: flex; align-items: center; height: 200px;"&amp;gt;
  &amp;lt;div&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/hrithick/embed/MWOpYEP?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flex Item Properties&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;align-self&lt;/strong&gt;: flex-start | flex-end | center | stretch | baseline&lt;br&gt;
The align-self property allows you to &lt;strong&gt;align an individual child along the cross-axis.&lt;/strong&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;div style="display: flex; height: 200px;"&amp;gt;
  &amp;lt;div style="align-self: flex-start;"&amp;gt;Item 1&amp;lt;/div&amp;gt;
  &amp;lt;div style="align-self: center;"&amp;gt;Item 2&amp;lt;/div&amp;gt;
  &amp;lt;div style="align-self: flex-end;"&amp;gt;Item 3&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/hrithick/embed/mjMXNw?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Growing and Shrinking&lt;/strong&gt;&lt;br&gt;
3 properties to know: &lt;code&gt;flex-grow&lt;/code&gt;, &lt;code&gt;flex-shrink&lt;/code&gt;, and &lt;code&gt;flex-basis&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;flex-grow:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This property defines how much a flex item will grow relative to the other items inside a flex container when there is extra space available. By default, &lt;code&gt;flex-grow&lt;/code&gt; is set to 0, meaning items won't grow beyond their natural size. Setting &lt;code&gt;flex-grow: 1&lt;/code&gt; allows the item to expand and occupy the remaining available space within the container.&lt;/p&gt;

&lt;p&gt;If multiple items have &lt;code&gt;flex-grow:1&lt;/code&gt; applied, they will divide the extra space proportionally, based on the grow values set for each item.&lt;/p&gt;

&lt;p&gt;Imagine a &lt;strong&gt;dashboard layout&lt;/strong&gt; where you have a sidebar and a main content area. You want the sidebar to stay fixed in size, but the main content area should expand and take up the remaining space.&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 style="display: flex;"&amp;gt;
  &amp;lt;div style="flex-grow: 0; width: 200px;"&amp;gt;Sidebar&amp;lt;/div&amp;gt; &amp;lt;!-- Fixed width sidebar --&amp;gt;
  &amp;lt;div style="flex-grow: 1;"&amp;gt;Main Content Area&amp;lt;/div&amp;gt; &amp;lt;!-- Expanding content area --&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;flex-shrink:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the container size reduces, items inside will also shrink proportionally.&lt;/p&gt;

&lt;p&gt;For example, consider a profile card with a rounded image and a name. As the container shrinks, the image may distort, turning from a circle to an oval. To prevent this, you can set &lt;code&gt;flex-shrink: 0&lt;/code&gt;, ensuring the image retains its original size while the rest of the content adapts.&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 style="display: flex;"&amp;gt;
  &amp;lt;img src="profile.jpg" style="flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%;" alt="Profile Picture"&amp;gt; &amp;lt;!-- Image won't shrink --&amp;gt;
  &amp;lt;div style="flex-shrink: 1;"&amp;gt;User Name&amp;lt;/div&amp;gt; &amp;lt;!-- Name can shrink --&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While you might think of using &lt;code&gt;min-width&lt;/code&gt; to achieve the same effect, &lt;code&gt;flex-shrink&lt;/code&gt; is a more straightforward and flexible approach within the Flexbox algorithm.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;flex-grow&lt;/code&gt; controls how extra space is distributed among items.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-shrink&lt;/code&gt; controls how space is reduced when the container size decreases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;flex-basis: Setting the Initial Size&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;flex-basis&lt;/code&gt; property defines the &lt;strong&gt;initial size&lt;/strong&gt; of a flex item. If the &lt;code&gt;flex-direction&lt;/code&gt; is set to &lt;code&gt;row&lt;/code&gt;, &lt;code&gt;flex-basis&lt;/code&gt; controls the &lt;strong&gt;width&lt;/strong&gt; of the items. If the &lt;code&gt;flex-direction&lt;/code&gt; is &lt;code&gt;column&lt;/code&gt;, it controls the &lt;strong&gt;height&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;flex-basis&lt;/code&gt; is similar to the &lt;code&gt;width&lt;/code&gt; or &lt;code&gt;height&lt;/code&gt; properties, but with one key difference: it only sets the &lt;strong&gt;initial&lt;/strong&gt; size, while allowing the item to grow or shrink depending on the available space and the &lt;code&gt;flex-grow&lt;/code&gt; and &lt;code&gt;flex-shrink&lt;/code&gt; values.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;flex-basis&lt;/code&gt; is set to &lt;code&gt;auto&lt;/code&gt; or &lt;code&gt;content&lt;/code&gt;, the size of the item is based on its content.&lt;/li&gt;
&lt;li&gt;If you want to define a fixed starting size but still allow the item to grow or shrink, use &lt;code&gt;flex-basis&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.child {
  flex-basis: 25%;  /* Starts at 25% width, but can grow to fill space */
  flex-grow: 1;     /* Will grow to take up more space if available */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the child element initially takes up &lt;strong&gt;25%&lt;/strong&gt; of the container’s width, but it can grow beyond that if there’s more space available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting a fixed size:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want the item to have a &lt;strong&gt;fixed size&lt;/strong&gt; (not grow or shrink), you can use the &lt;code&gt;flex&lt;/code&gt; shorthand, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.child {
  flex: 0 0 100px; /* No growth, no shrinking, stays fixed at 100px */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shorthand breaks down as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;0&lt;/code&gt; (flex-grow)&lt;/strong&gt;: The item will not grow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;0&lt;/code&gt; (flex-shrink)&lt;/strong&gt;: The item will not shrink.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;100px&lt;/code&gt; (flex-basis)&lt;/strong&gt;: The item has a fixed size of 100px.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using &lt;code&gt;width&lt;/code&gt; instead of &lt;code&gt;flex-basis&lt;/code&gt; inside a flex layout can lead to issues sometimes.because the item defined with width and won't adjust if the container grows or shrinks, making the layout less responsive. So use it appropriately.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/hrithick/embed/YjxemN?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;align-content:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We've already learned about flex-wrap. Flex-wrap allows flex items to wrap to the next lines instead of shrinking, right?&lt;/p&gt;

&lt;p&gt;Each of these flex lines acts like a separate "mini flex container". We also know that the align-items property is used to align items on the cross axis. Here, this align-items property will work inside this flex line only, because as I mentioned, each line itself is a mini flex container. We also have an outer flex container, right? If we need to align these lines with respect to the outer container, we need one more property that aligns these flex lines on the cross axis. That property is align-content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  height: 300px;
}

.item {
  width: 30%;
  height: 50px;
  background-color: #3498db;
  margin: 5px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we have a flex container with multiple items that wrap onto multiple lines. The &lt;code&gt;align-content: center;&lt;/code&gt; property centers the wrapped lines along the container's cross-axis. &lt;/p&gt;

&lt;p&gt;The possible values for &lt;code&gt;align-content&lt;/code&gt; include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;flex-start&lt;/code&gt;: Lines are aligned toward the start of the container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-end&lt;/code&gt;: Lines are aligned toward the end of the container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;center&lt;/code&gt;: Lines are centered in the container.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;space-between&lt;/code&gt;: Lines are evenly distributed; the first line is at the start of the container while the last one is at the end.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;space-around&lt;/code&gt;: Lines are evenly distributed with equal space around each line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;stretch&lt;/code&gt; (default): Lines stretch to take up the remaining space.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/hrithick/embed/VBzQom?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gaps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The gap property was not available in earlier versions of Flexbox. Previously, developers relied on margin properties to create space between flex items. The introduction of the gap property marked a significant improvement in Flexbox functionality.&lt;/p&gt;

&lt;p&gt;It provides a straightforward method for creating space between flex items, simplifying the layout process.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
  display: flex;
  gap: 10px; /* Adds a 10px gap between all flex items */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Auto margins
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;margin: auto:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Last but not least, a commonly used spacing trick&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;margin: auto&lt;/code&gt; property in Flexbox is a powerful tool for aligning flex items. It automatically uses the leftover space around the item, making it useful for centering or pushing items to opposite sides of a container.&lt;/p&gt;

&lt;p&gt;For example, you can use &lt;code&gt;margin-left: auto&lt;/code&gt; to push an item to the right side of a flex container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
  display: flex;
}

.push-right {
  margin-left: auto;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/hrithick/embed/djzdxp?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This technique allows for quick and easy alignment without the need for additional positioning properties.&lt;/p&gt;

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

&lt;p&gt;In this guide, we explored how Flexbox has simplified the task of aligning and distributing items within a webpage. Flexbox isn't just a layout tool—it's a critical skill for any web developer aiming to create responsive, well-structured designs. I hope this guide has helped you understand the power of Flexbox. &lt;/p&gt;

&lt;p&gt;Try these demos and feel free to share your thoughts or questions. Thanks!&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>flexbox</category>
      <category>ui</category>
    </item>
    <item>
      <title>Test post</title>
      <dc:creator>Ramkumar.barani</dc:creator>
      <pubDate>Sun, 08 Aug 2021 06:49:52 +0000</pubDate>
      <link>https://dev.to/ramk777stack/test-post-37bk</link>
      <guid>https://dev.to/ramk777stack/test-post-37bk</guid>
      <description>&lt;p&gt;Test data&lt;/p&gt;

&lt;p&gt;test post&lt;/p&gt;

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