<?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: Rakshit Maini</title>
    <description>The latest articles on DEV Community by Rakshit Maini (@rakshitmaini).</description>
    <link>https://dev.to/rakshitmaini</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%2F586408%2Fae3a3c98-e78b-486a-9db1-5a586d35ba86.jpeg</url>
      <title>DEV Community: Rakshit Maini</title>
      <link>https://dev.to/rakshitmaini</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rakshitmaini"/>
    <language>en</language>
    <item>
      <title>JS Array Reduce - Basics to Advanced and custom Reduce Method 🔥</title>
      <dc:creator>Rakshit Maini</dc:creator>
      <pubDate>Thu, 27 Jul 2023 15:47:06 +0000</pubDate>
      <link>https://dev.to/rakshitmaini/array-reduce-basics-to-advanced-and-custom-reduce-2gnj</link>
      <guid>https://dev.to/rakshitmaini/array-reduce-basics-to-advanced-and-custom-reduce-2gnj</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Ji7CjnP66YM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Initially thought of writing this content but found out later, it's a lot to jot down so ended up recording the video, LOL(for the first time).😄 &lt;/p&gt;

&lt;p&gt;Ps: Please don't expect it to be a short video, it is 28mins long but it contains everything for you to understand from very basic understanding to getting used to it really well.&lt;/p&gt;

&lt;p&gt;I hope it clears all your doubts around it and if not feel free to reach out in the comment section down below. Cheers!&lt;/p&gt;

&lt;p&gt;Keep learning, keep rolling!! 🛼 🙌&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Everyday Concepts #1: What is '??' operator in Javascript</title>
      <dc:creator>Rakshit Maini</dc:creator>
      <pubDate>Thu, 15 Jun 2023 08:22:30 +0000</pubDate>
      <link>https://dev.to/rakshitmaini/everyday-concepts-1-what-is-operator-in-javascript-30k</link>
      <guid>https://dev.to/rakshitmaini/everyday-concepts-1-what-is-operator-in-javascript-30k</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey guys, this is my first post on web DEV.to, hope you like it. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will be a 10 part series, in each post I will share some basic problems and concepts that you come across while working. We often miss out on these things though they are part of Javascript, but as you know, we can't keep track of all the new rules.&lt;/p&gt;

&lt;p&gt;So you might have seen sometimes some other developer writing &lt;strong&gt;??&lt;/strong&gt;. Actually, this a &lt;strong&gt;Nullish Coalescing Operator(??)&lt;/strong&gt; which is a logical operator which returns its right-hand side operand when its left-hand side is &lt;strong&gt;null or undefined&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"??"&lt;/strong&gt; &amp;lt;- That looks weird to me, wtf is that Rakshit 🙄&lt;/p&gt;

&lt;p&gt;You might be thinking &lt;strong&gt;OR operator(||) does the same thing&lt;/strong&gt;, what is the purpose of &lt;strong&gt;??&lt;/strong&gt; then. Yes, you are right the OR operator would also return the right-hand side when the left-hand side would be null or undefined, but there's a big catch to that. &lt;/p&gt;

&lt;p&gt;So bud, OR operator(||) would return the right-hand side if the left side would be any &lt;em&gt;&lt;strong&gt;falsy&lt;/strong&gt;&lt;/em&gt; value, that's the variation here.  Since null and undefined come under falsy values, it would look like it is doing the same thing but there aren't just these falsy values. &lt;/p&gt;

&lt;p&gt;Let's look how these falsy values look like:&lt;br&gt;
the number 0&lt;br&gt;
the BigInt 0n.&lt;br&gt;
the keyword null.&lt;br&gt;
the keyword undefined.&lt;br&gt;
the boolean false.&lt;br&gt;
the number NaN.&lt;br&gt;
the empty string "" (equivalent to '' or `` ).&lt;/p&gt;

&lt;p&gt;So the crux is the &lt;strong&gt;OR operator(||)&lt;/strong&gt; would return the right-hand side for all the &lt;em&gt;&lt;strong&gt;falsy values&lt;/strong&gt;&lt;/em&gt; mentioned above whereas &lt;strong&gt;Nullish Coalescing Operator(??)&lt;/strong&gt; would return the right-hand side only when the left-hand side is either &lt;em&gt;&lt;strong&gt;null or undefined&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Isn't it cool....Haha 😁&lt;/p&gt;

&lt;p&gt;Well let's try to understand it with some case in point 💬&lt;/p&gt;

&lt;p&gt;&lt;code&gt;null || undefined ?? "Elon"; // raises a SyntaxError - use paranthesis to put the left side together!&lt;br&gt;
(null || undefined) ?? "Musk"; // returns "Musk"&lt;br&gt;
(true &amp;amp;&amp;amp; false) ?? "Roadster" // returns false&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PS: This is a recent addition to the language. Old browsers may need polyfills.&lt;/strong&gt; Hope next time you will now think before using || operator, whether it is required or if ?? can serve the purpose. &lt;/p&gt;

&lt;p&gt;I hope I have been able to make you understand, if not feel free to comment will share more example problems to better explain the concepts. Keep it rolling, coming up with more concepts and problems like these! Cheers guys ✌🏻&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
