<?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>Forem: AshikPaul42</title>
    <description>The latest articles on Forem by AshikPaul42 (@ashikpaul42).</description>
    <link>https://forem.com/ashikpaul42</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%2F397995%2F9819a5cb-2f9b-49a8-a4ec-4d961ec067bb.png</url>
      <title>Forem: AshikPaul42</title>
      <link>https://forem.com/ashikpaul42</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ashikpaul42"/>
    <language>en</language>
    <item>
      <title>How to count occurrences of dates in an array of date ranges: JavaScript</title>
      <dc:creator>AshikPaul42</dc:creator>
      <pubDate>Mon, 08 Jun 2020 05:12:06 +0000</pubDate>
      <link>https://forem.com/ashikpaul42/how-to-count-occurrences-of-dates-in-an-array-of-date-ranges-javascript-kjo</link>
      <guid>https://forem.com/ashikpaul42/how-to-count-occurrences-of-dates-in-an-array-of-date-ranges-javascript-kjo</guid>
      <description>&lt;p&gt;I have a date-range of 01-01-2020 to 31-12-2020 and an array of date-ranges. I want the occurrence of each date in the array vs the main range.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Eg: mainRange =&amp;gt; 01-01-2020 to 31-12-2020

    dateRanges =[
      [01-01-2020, 03-01-2020],
      [03-01-2020, 04-01-2020],
      [03-01-2020, 06-01-2020]
    ];

    the output should be =&amp;gt;

    countArr = [1,1,3,2,1,1,0,0,......,0]; //array length 365
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I was desparate and I had posted the same on &lt;a href="https://stackoverflow.com/questions/62255316/how-to-count-occurrences-of-dates-in-an-array-of-date-ranges-javascript"&gt;stackoverflow&lt;/a&gt; too. 🥺&lt;/p&gt;

&lt;p&gt;SOLUTION :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var range1 = new Date(2020, 0, 1),
    range2 = new Date(2020, 11, 31),
    dateRanges =[
        [new Date(2020, 0, 1), new Date(2020, 0, 3)],
        [new Date(2020, 0, 3), new Date(2020, 0, 4)],
        [new Date(2020, 0, 3), new Date(2020, 0, 6)],
    ],
    result = [];

while (range1 &amp;lt;= range2) {
    var count = 0;
    dateRanges.forEach(
        function(range) {
            if (range1 &amp;gt;= range[0] &amp;amp;&amp;amp; range1 &amp;lt;= range[1]) {
                count++;
            }
        }
    );
    result.push(count);
    range1.setDate(range1.getDate() + 1); //+1 day
}

console.log(result);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Thank you 😍&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>array</category>
    </item>
    <item>
      <title>Where do I start to become a MERN or Full stack Developer?</title>
      <dc:creator>AshikPaul42</dc:creator>
      <pubDate>Wed, 03 Jun 2020 11:20:58 +0000</pubDate>
      <link>https://forem.com/ashikpaul42/how-do-i-start-as-a-mern-or-full-stack-developer-mjf</link>
      <guid>https://forem.com/ashikpaul42/how-do-i-start-as-a-mern-or-full-stack-developer-mjf</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1R68Md_w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cyl6turua2huugmnqwap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1R68Md_w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cyl6turua2huugmnqwap.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I saw this &lt;a href="https://www.youtube.com/watch?v=JnEH9tYLxLk"&gt;video&lt;/a&gt; a few weeks ago and really got motivate to become a full stack developer. Thank you so much @CodingTrain and @CodingGardenCJ for this. &lt;/p&gt;

&lt;p&gt;It just took me 4 hours(many issues) to watch and implement as shown in the video in React. Later I added a Map that marks the location of the users who visited my site. 😁&lt;/p&gt;

&lt;p&gt;But now I am stuck. I searched for more simple full stack projects to improve, but all seem complicated and time consuming and not as simple as the video.&lt;/p&gt;

&lt;p&gt;Please comment or DM me some links where I can start learning with similar projects and this might help others too.&lt;/p&gt;

&lt;p&gt;Thank you😍&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>help</category>
      <category>question</category>
    </item>
  </channel>
</rss>
