<?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: Maulik Chaudhary</title>
    <description>The latest articles on DEV Community by Maulik Chaudhary (@const_variable).</description>
    <link>https://dev.to/const_variable</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%2F1485990%2F9a488686-d329-4bf4-a56c-70c3a4b245a6.jpeg</url>
      <title>DEV Community: Maulik Chaudhary</title>
      <link>https://dev.to/const_variable</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/const_variable"/>
    <language>en</language>
    <item>
      <title>"if" and "?": how they're different in Javscript</title>
      <dc:creator>Maulik Chaudhary</dc:creator>
      <pubDate>Wed, 15 May 2024 10:36:51 +0000</pubDate>
      <link>https://dev.to/const_variable/if-and-how-theyre-different-in-javscript-411e</link>
      <guid>https://dev.to/const_variable/if-and-how-theyre-different-in-javscript-411e</guid>
      <description>&lt;p&gt;You might have come across the conditional code which has "if" statements and at same time conditional code with &lt;em&gt;?&lt;/em&gt; question mark operator is also widely being used. &lt;/p&gt;

&lt;p&gt;If both does the same thing then what is the &lt;strong&gt;best practice&lt;/strong&gt; and when to use which?!&lt;/p&gt;

&lt;p&gt;Turns out, &lt;/p&gt;

&lt;p&gt;&lt;em&gt;if&lt;/em&gt; statement is used when we just want to &lt;strong&gt;execute&lt;/strong&gt; some block of code based on the condition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
 alert("Hello World");
else {
 alert("Good night!");
}

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

&lt;/div&gt;



&lt;p&gt;if we want to assign the result of a condition to a variable then question mark operator is something you should use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const allowedAccess = age &amp;gt; 23 ? true : false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;although both can be used interchangeably. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Is null a dataType in Javascript?</title>
      <dc:creator>Maulik Chaudhary</dc:creator>
      <pubDate>Sun, 12 May 2024 10:39:54 +0000</pubDate>
      <link>https://dev.to/const_variable/is-null-a-datatype-in-javascript-1ol2</link>
      <guid>https://dev.to/const_variable/is-null-a-datatype-in-javascript-1ol2</guid>
      <description>&lt;p&gt;Well only way to check that out is to use typeof for different values. &lt;br&gt;
If you check with all the possibilities, you'll find out that there are eight dataTypes: &lt;/p&gt;

&lt;p&gt;number, &lt;br&gt;
bigint, &lt;br&gt;
string, &lt;br&gt;
boolean, &lt;br&gt;
undefined, &lt;br&gt;
object, &lt;br&gt;
symbol, &lt;br&gt;
function&lt;/p&gt;

&lt;p&gt;Yes, you might be wondering what about &lt;strong&gt;null&lt;/strong&gt;? &lt;br&gt;
&lt;strong&gt;null&lt;/strong&gt; falls under object dataType: &lt;/p&gt;

&lt;p&gt;check yourself by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;typeof(null); // object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s an officially recognised error in typeof. Definitely, &lt;strong&gt;null&lt;/strong&gt; is not an &lt;em&gt;object&lt;/em&gt;. It is a special value with a separate type of its own. The behaviour of &lt;strong&gt;typeof&lt;/strong&gt; is wrong here.&lt;/p&gt;

&lt;p&gt;but if you dig deeper, functions are also an object. &lt;br&gt;
So there is nothing right and nothing wrong here, it depends what context and usecase you're targeting. &lt;/p&gt;

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