<?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: Hardik Mirg</title>
    <description>The latest articles on DEV Community by Hardik Mirg (@hardikmirg).</description>
    <link>https://dev.to/hardikmirg</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%2F799999%2F0e94acbd-3941-4eb7-94c2-85f599ebbb3d.jpg</url>
      <title>DEV Community: Hardik Mirg</title>
      <link>https://dev.to/hardikmirg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hardikmirg"/>
    <language>en</language>
    <item>
      <title>Stop Using Create-React-App!</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Sun, 03 Apr 2022 08:34:21 +0000</pubDate>
      <link>https://dev.to/hardikmirg/stop-using-create-react-app-3f57</link>
      <guid>https://dev.to/hardikmirg/stop-using-create-react-app-3f57</guid>
      <description>&lt;h2&gt;
  
  
  STOP USING CREATE-REACT-APP, USE THIS INSTEAD~
&lt;/h2&gt;

&lt;p&gt;Every React Developer starting its react journey starts either with The &lt;a href="https://reactjs.org"&gt;React.js Documentation&lt;/a&gt; or with YouTube Tutorials.&lt;/p&gt;

&lt;p&gt;The problem with that is both of them teach us to initialize our app with Create-react-app, or CRA for short.&lt;/p&gt;

&lt;p&gt;Now, You might think, what's wrong with that?&lt;/p&gt;

&lt;p&gt;Well, The actual problem with CRA is that it's too good!&lt;br&gt;
A better way to say it will be, "It's just not for beginners"&lt;/p&gt;

&lt;p&gt;CRA provides a bunch of tools not required for basic applications, which surely makes it overwhelming for beginners and makes our app slow in various ways.&lt;/p&gt;

&lt;p&gt;Due to the excessive amount of libraries required by CRA, It takes a lot longer bundling time than &lt;u&gt;&lt;strong&gt;VITE&lt;/strong&gt;&lt;/u&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vitejs.dev"&gt;Vite&lt;/a&gt; makes it a lot easier for developers.&lt;/p&gt;

&lt;p&gt;It doesn't require excessive libraries, making the bundling time drop at a significant rate!&lt;/p&gt;

&lt;p&gt;It supports HMR, which is extremely useful for developing state based react components.&lt;/p&gt;

&lt;p&gt;An insane feature that makes Vite faster than any bundling tool out there is that in a React app, instead of bundling our app and then sending it to the browser, it loads our raw JSX or TSX files!&lt;/p&gt;

&lt;p&gt;CRA is not even close when compared to speed tests.&lt;/p&gt;

&lt;p&gt;To get started with Vite JS, open a new Terminal Window and make sure you have NodeJS installed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm init vite&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TTqKU8hg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifdjfdphw8ivecl62wsg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TTqKU8hg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifdjfdphw8ivecl62wsg.png" alt="" width="480" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter your project's name and select the framework of your choice.&lt;br&gt;
You can even choose between JS and TS.&lt;/p&gt;

&lt;p&gt;And just like that, your React projects it set up literally under 5 seconds!&lt;/p&gt;

&lt;p&gt;Just CD into your folder and install the necessary dependencies using &lt;code&gt;npm i&lt;/code&gt; or &lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;npm run dev&lt;/code&gt; to start your local development server!&lt;/p&gt;

&lt;p&gt;Or, to do all that quickly, just run: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd &amp;lt;project-name&amp;gt; &amp;amp;&amp;amp; npm i &amp;amp;&amp;amp; npm run dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;JUST VISIT &lt;code&gt;http://localhost:3000&lt;/code&gt; AND HERE YOU GO!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DacUDM54--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92evo2wj03bb2oillalp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DacUDM54--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92evo2wj03bb2oillalp.png" alt="Image description" width="746" height="599"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  Congrats! Now you can develop your React apps faster than ever!
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learnt something useful today, See you later!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>cra</category>
      <category>vite</category>
    </item>
    <item>
      <title>Escape Sequence Characters in JavaScript</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Wed, 23 Mar 2022 18:05:04 +0000</pubDate>
      <link>https://dev.to/hardikmirg/escape-sequence-characters-in-javascript-4l8k</link>
      <guid>https://dev.to/hardikmirg/escape-sequence-characters-in-javascript-4l8k</guid>
      <description>&lt;h2&gt;
  
  
  Escape Sequence Characters
&lt;/h2&gt;

&lt;p&gt;Escape Sequence Characters, as the name suggests, is used to escape a particular sequence or to display special characters. They can also be used withing strings.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;\' Single quote&lt;/li&gt;
&lt;li&gt;\" Double Quoted&lt;/li&gt;
&lt;li&gt;\ Backslash&lt;/li&gt;
&lt;li&gt;\b backspace&lt;/li&gt;
&lt;li&gt;\f form feed&lt;/li&gt;
&lt;li&gt;\n newline&lt;/li&gt;
&lt;li&gt;\r carriage return&lt;/li&gt;
&lt;li&gt;\t horizontal tabulator&lt;/li&gt;
&lt;li&gt;\v vertical tabulator&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Truthy - Falsy Values in JavaScript</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Wed, 23 Mar 2022 17:58:42 +0000</pubDate>
      <link>https://dev.to/hardikmirg/truthy-falsy-values-in-javascript-1i20</link>
      <guid>https://dev.to/hardikmirg/truthy-falsy-values-in-javascript-1i20</guid>
      <description>&lt;h2&gt;
  
  
  Truthy and Falsy Values
&lt;/h2&gt;

&lt;p&gt;Anything in JavaScript is either True or False.&lt;/p&gt;

&lt;p&gt;There are different values to denote whether something is True or False.&lt;/p&gt;




&lt;h3&gt;
  
  
  Falsy Values
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;false&lt;/li&gt;
&lt;li&gt;0&lt;/li&gt;
&lt;li&gt;null&lt;/li&gt;
&lt;li&gt;Undefined&lt;/li&gt;
&lt;li&gt;NaN&lt;/li&gt;
&lt;li&gt;Empty String&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Truthy Values
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Anything that isn't Falsy.&lt;/li&gt;
&lt;li&gt;Empty arrays and objects are Truthy.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Conditional Statements</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Wed, 23 Mar 2022 16:47:29 +0000</pubDate>
      <link>https://dev.to/hardikmirg/conditional-statements-ghe</link>
      <guid>https://dev.to/hardikmirg/conditional-statements-ghe</guid>
      <description>&lt;h2&gt;
  
  
  Conditional statements
&lt;/h2&gt;

&lt;p&gt;Conditional Statements, as the name suggests, only execute a statement, or a bunch of statements only if a condition is true.&lt;/p&gt;

&lt;p&gt;Before learning about the different types of Conditional statements, let's have a look at some, not so frequently used, terms.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Condition: An expression whose value is considered as a condition.&lt;/li&gt;
&lt;li&gt;ExprIfTrue: An expression that is executed if the condition is 
Truthy.&lt;/li&gt;
&lt;li&gt;ExprIfFalse: An expression that is executed if the condition is 
Falsy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Posts on Truth and Falsy values coming soon~&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Ways to implement Conditional Statements in JavaScript
&lt;/h2&gt;

&lt;p&gt;To make use of Conditional statements, we need to use the &lt;a href="https://dev.to/hardikmirg/functions-in-javascript-17b1"&gt;operators&lt;/a&gt; provided in JavaScript, or, if we don't use any operator but just a variable, The condition will be considered true if the variable provided is anything accepted being a falsy value.&lt;/p&gt;

&lt;h3&gt;
  
  
  If statements
&lt;/h3&gt;

&lt;p&gt;"If statements" are the most frequently used Conditional statements in JavaScript.&lt;br&gt;
It has a very simple, elegant, function-like, and self-explanatory syntax. We just need to use the "if" keyword instead of "function".&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;let&lt;/span&gt; &lt;span class="nx"&gt;hour&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&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;hour&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;12&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="nx"&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;It's not afternoon yet.&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What if we have more than 1 condition?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For that we have:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  If-else statements
&lt;/h3&gt;

&lt;p&gt;They are very similar to if statements and in fact can only be used once a statement is started.&lt;/p&gt;

&lt;p&gt;We use the "else" keyword to provide another "if" condition or we can simply use the "else" keyword to provide a statement that will only execute if none of the provided statements were true.&lt;/p&gt;

&lt;p&gt;Let's learn to write "If-else" Statements by writing a program to determine whether a number is odd or even.&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;let&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;5&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;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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&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;num&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; is even`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&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;num&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; is odd`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we used the modulus operator than returns the remainder when the first operand is divided by the second, in this case, the remainder when 5 is divided by 2 is not 0, so it moves to the next else statement and prints that it's odd.&lt;/p&gt;

&lt;h3&gt;
  
  
  Switch Case Statements
&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;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expression&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
   &lt;span class="c1"&gt;// some code&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;// some code&lt;/span&gt;
 &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
   &lt;span class="c1"&gt;// some code&lt;/span&gt;
 &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
   &lt;span class="c1"&gt;// some code&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 switch expression is evaluated once.&lt;/li&gt;
&lt;li&gt;The value of the expression is compared with the values of each case.&lt;/li&gt;
&lt;li&gt;If there is a match, the associated block of code is executed.&lt;/li&gt;
&lt;li&gt;If there is no match, the default code block is Executed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ternary Operator
&lt;/h3&gt;

&lt;p&gt;The Ternary Operator can be considered a short-hand method to writing if statements, it's used in the following way:&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="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;ExprIfTrue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ExprIfFalse&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Functions In JavaScript</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Tue, 22 Mar 2022 16:56:16 +0000</pubDate>
      <link>https://dev.to/hardikmirg/functions-in-javascript-17b1</link>
      <guid>https://dev.to/hardikmirg/functions-in-javascript-17b1</guid>
      <description>&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;p&gt;Functions are important, vastly used, reusable code blocks, or just a piece of code that you can use again and again.&lt;/p&gt;

&lt;p&gt;Functions accept parameters as variables, which makes them even more useful based on the Value Accepted by it as a parameter.&lt;/p&gt;

&lt;p&gt;Parameters in functions can be of any data type, ranging from a simple integer, an array, or even an Array full of Arrays!&lt;/p&gt;

&lt;h3&gt;
  
  
  Ways to declare a function
&lt;/h3&gt;

&lt;p&gt;There are several ways to declare a function. Something they all have in common is Parentheses &lt;code&gt;()&lt;/code&gt; and Curly Braces &lt;code&gt;{}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can accept a parameter in a function just by writing it inside the Parentheses.&lt;/p&gt;

&lt;p&gt;All the code executed by the function is contained within the curly braces.&lt;/p&gt;

&lt;p&gt;1) The Classic Way&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;function&lt;/span&gt; &lt;span class="nx"&gt;sayHello&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="nx"&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;Hello Dev!&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) Function contained in a variable&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;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&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="nx"&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;Hello Dev!&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3) The ES6 way; Arrow Functions&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;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&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;Hello Dev!&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The javascript ES6 version introduced many amazing features to the language but one of the most useful was Arrow Functions. &lt;/p&gt;

&lt;p&gt;They have a few differences from Normal Function, which we'll talk about in an upcoming post.&lt;/p&gt;

&lt;p&gt;They're just functions stored in a variable but do not use the "function" keyword. Assign a pair of Parentheses to a variable and make an arrow &lt;code&gt;=&amp;gt;&lt;/code&gt; to determine that it's an arrow function and continue with curly braces as normal.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Arrow Functions can't be used in any version before ES6&lt;/em&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Calling (Running) a function
&lt;/h3&gt;

&lt;p&gt;To call a function, first declare it in your code.&lt;/p&gt;

&lt;p&gt;(Here, we'll use the arrow function we declared a while ago.)&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;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&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;Hello Dev!&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have our function declared!&lt;br&gt;
Now, to call it anywhere within our file, we just need to mention the function name with parentheses.&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="nx"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;// This prints out "Hello Dev!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accepting Parameters
&lt;/h3&gt;

&lt;p&gt;To make our function use parameters provided by the user, we just need to name them within the Parentheses.&lt;/p&gt;

&lt;p&gt;Let's make a simple arrow function that squares a number provided as a parameter and prints it to the console.&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;square&lt;/span&gt; &lt;span class="o"&gt;=&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;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="nx"&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="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// We mentioned "num" within the Parentheses of our function to denote that we need a parameter for "num".&lt;/span&gt;

&lt;span class="c1"&gt;// Notice how we don't use any quotation marks though we've never declared "num"&lt;/span&gt;

&lt;span class="c1"&gt;// To call this function, we'll simply name it with parentheses, but within the Parentheses, we can provide a value that will be given to "num"&lt;/span&gt;

&lt;span class="nx"&gt;square&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="c1"&gt;// returns 25.&lt;/span&gt;

&lt;span class="c1"&gt;// We can have multiple parameters like this:&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;city&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="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`
        Name: &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="s2"&gt;
        Age: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
        City: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;city&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;span class="c1"&gt;// We can provide values to multiple parameters like this:&lt;/span&gt;

&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Josh&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;London&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above example returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name: Josh
Age: 21
City: London
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: While printing the name, age, and City provided by the user, we used something known as Template Literals, more posts on that topic soon!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We need to provide all possible parameters, We could just possibly add 2 parameters and it'll be considered as the first 2 parameters declared in the function body.&lt;/p&gt;

&lt;p&gt;If we only want to provide the 1st and 3rd parameters, we can skip the 2nd parameter like this:&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="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mike&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Paris&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name: Mike
Age: Undefined
City: Paris
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nested Functions
&lt;/h3&gt;

&lt;p&gt;We can create new functions inside of other functions but functions are block-scoped, i.e. You can only refer to the function within the function you declared it and not anywhere else in your code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Operators in JavaScript</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Sun, 20 Mar 2022 12:18:21 +0000</pubDate>
      <link>https://dev.to/hardikmirg/operators-in-javascript-258e</link>
      <guid>https://dev.to/hardikmirg/operators-in-javascript-258e</guid>
      <description>&lt;h2&gt;
  
  
  Operators in JavaScript
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basic Operators&lt;/li&gt;
&lt;li&gt;Comparison Operators&lt;/li&gt;
&lt;li&gt;Logical Operators&lt;/li&gt;
&lt;li&gt;Bitwise Operators&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Basic Operators
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;+&lt;/code&gt; Addition&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-&lt;/code&gt; Subtraction&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt; Multiplication&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/&lt;/code&gt; Division&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;%&lt;/code&gt; Modulus&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;++&lt;/code&gt; Increment&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--&lt;/code&gt; Decrement&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;()&lt;/code&gt; Group&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Comparision Operators
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;==&lt;/code&gt; Equal Value&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;===&lt;/code&gt; Equal Value And Same Type&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;!=&lt;/code&gt; Not Equal Value&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;!==&lt;/code&gt; Not Equal Value And Different Type&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&lt;/code&gt; Greater Than&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;&lt;/code&gt; Less Than&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;=&lt;/code&gt; Greater than and Equal to&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;=&lt;/code&gt; Lesser than and Equal to.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Logical Operators
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; Logical And&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;||&lt;/code&gt; Logical OR&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;!&lt;/code&gt; Logical Not&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  BitWise Operators
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&lt;/code&gt; AND statement&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;|&lt;/code&gt; OR statement&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~&lt;/code&gt; NOT&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; XOR&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; Zero fill left shift&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; Signed right shift&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; Zero Fill right shift&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Data Types in JavaScript</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Sat, 19 Mar 2022 10:51:51 +0000</pubDate>
      <link>https://dev.to/hardikmirg/data-types-javascript-2gfm</link>
      <guid>https://dev.to/hardikmirg/data-types-javascript-2gfm</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Data Types in JavaScript&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Primitive Data Types&lt;/li&gt;
&lt;li&gt;Non-Primitive Data Types&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Primitive Data Types&lt;/em&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Integer: 1, 2, 3, etc.&lt;/li&gt;
&lt;li&gt;String: "Hello World" etc.&lt;/li&gt;
&lt;li&gt;Boolean: True/False.&lt;/li&gt;
&lt;li&gt;Null: Used to depict no value.&lt;/li&gt;
&lt;li&gt;Undefined: Variables with no defined value.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Non-Primitive Data Types&lt;/em&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Object: Instance of key-value pairs; Similar to JSON; Contained within curly braces {}.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Array: A group of variables of any Data Types contained together within brackets []; Similar to lists in Python.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RegExp: Refers to "Regular Expression"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Var vs Const vs Let (JavaScript)</title>
      <dc:creator>Hardik Mirg</dc:creator>
      <pubDate>Thu, 17 Mar 2022 10:04:16 +0000</pubDate>
      <link>https://dev.to/hardikmirg/var-vs-const-vs-let-javascript-2530</link>
      <guid>https://dev.to/hardikmirg/var-vs-const-vs-let-javascript-2530</guid>
      <description>&lt;h2&gt;
  
  
  Variable Declarations
&lt;/h2&gt;

&lt;p&gt;There are several ways of declaring values to variables in javascript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Var&lt;/li&gt;
&lt;li&gt;Const&lt;/li&gt;
&lt;li&gt;Let&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Var
&lt;/h3&gt;

&lt;p&gt;var stands for "variable" is used to declare variables that can be reassigned and are only available inside the function they're created in. They're function scoped.&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;var&lt;/span&gt; &lt;span class="nx"&gt;word&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// returns "hello"&lt;/span&gt;

&lt;span class="nx"&gt;word&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bye&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// can be re-assigned ✅&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// returns "bye"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Const
&lt;/h3&gt;

&lt;p&gt;const stands for "constant" and is used to declare variables that cannot be reassigned and are not accessible before they appear within the code. They're block scoped.&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;word&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// returns "hello"&lt;/span&gt;

&lt;span class="nx"&gt;word&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bye&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// cannot be re-assigned ❌&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// throws an error as constants cannot be re-assigned&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Let
&lt;/h3&gt;

&lt;p&gt;Variables declared using let can be reassigned but are similar to const i.e. block scoped. If variables are not created inside a function or block they are globally scoped.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Block&lt;/p&gt;

&lt;p&gt;A block is a set of opening and closing curly brackets.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Hope you learned something useful today! Peace Out ✌️&lt;/p&gt;
&lt;/blockquote&gt;

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