<?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: Pankaj</title>
    <description>The latest articles on Forem by Pankaj (@pankajsanam).</description>
    <link>https://forem.com/pankajsanam</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%2F157257%2Fb45411f0-d40d-4f11-b419-2d258a9af05e.jpg</url>
      <title>Forem: Pankaj</title>
      <link>https://forem.com/pankajsanam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pankajsanam"/>
    <language>en</language>
    <item>
      <title>Variable Types in Javascript</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Sun, 04 Oct 2020 21:00:09 +0000</pubDate>
      <link>https://forem.com/pankajsanam/variable-types-in-javascript-p00</link>
      <guid>https://forem.com/pankajsanam/variable-types-in-javascript-p00</guid>
      <description>&lt;p&gt;This article specifically talks about the variable types in Javascript. The reason I dedicated an entire post for this is, that, there are a lot of tricky interview questions that come out of this. There are many gotchas included. So this deserves its own separate article.&lt;/p&gt;

&lt;p&gt;There are mainly 6 types of data types available in JavaScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Number&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Null&lt;/li&gt;
&lt;li&gt;Undefined&lt;/li&gt;
&lt;li&gt;Object&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Although, these data types are also divided into two categories:&lt;/p&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;p&gt;You will see the gotchas and examples of some of these in this post. Although a separate article would be required for Object data types as it holds a lot of things worth of explanation&lt;/p&gt;

&lt;h2&gt;
  
  
  1. String
&lt;/h2&gt;

&lt;p&gt;It can possibly hold any value. It's one of the primitive data types. Primitive data types cannot be mutated.&lt;/p&gt;

&lt;p&gt;For example, we can access each character in a string 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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pankaj&lt;/span&gt;&lt;span class="dl"&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;name&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// 'p'&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;name&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="c1"&gt;// 'a'&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;name&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="c1"&gt;// 'n'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But we cannot re-assign the values in primitive data types 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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pankaj&lt;/span&gt;&lt;span class="dl"&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;t&lt;/span&gt;&lt;span class="dl"&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;name&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// 'p'&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;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 'pankaj'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So primitive data types are immutable and cannot be modified like this.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Number
&lt;/h2&gt;

&lt;p&gt;According to the ECMAScript standard, the Number holds a double-precision 64-bit binary format IEEE 754 value.&lt;/p&gt;

&lt;p&gt;The number data type can hold all possible numerical values including the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;NaN&lt;/code&gt; (Not-a-Number)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+Infinity&lt;/code&gt; (Positive infinity)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-Infinity&lt;/code&gt; (Negative infinity)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The above three are special kinds of data that can be stored in Number data types.&lt;/p&gt;

&lt;h4&gt;
  
  
  NaN (Not-a-Number)
&lt;/h4&gt;

&lt;p&gt;It is a special value that's returned by Javascript when parsing of a number is failed for some reason.&lt;/p&gt;

&lt;p&gt;It doesn't equal to itself.&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;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="kc"&gt;NaN&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;NaN&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&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="kc"&gt;NaN&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;NaN&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can verify if a value is &lt;code&gt;NaN&lt;/code&gt; or not by using &lt;code&gt;isNaN()&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;But be careful while using the &lt;code&gt;isNaN()&lt;/code&gt; function because it first tries to convert the value that you pass to it into a number through type conversion and, as a result, some values convert into numbers while others don't.&lt;/p&gt;

&lt;p&gt;For example:&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;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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;NaN&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// true&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// true&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;({}));&lt;/span&gt; &lt;span class="c1"&gt;// true&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// false&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="nb"&gt;isNaN&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="c1"&gt;// false&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// false&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// false&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;     &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// false&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;90&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// false&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="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Ant Man&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Boolean
&lt;/h2&gt;

&lt;p&gt;This is one of the most simple data types which either holds &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Null
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;null&lt;/code&gt; is used when you want to declare a variable and intentionally express the absence of a value (unlike &lt;code&gt;undefined&lt;/code&gt; where the value is simply absent).&lt;/p&gt;

&lt;p&gt;Here is a gotcha with &lt;code&gt;null&lt;/code&gt; values:&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;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="k"&gt;typeof&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 'object'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The type of &lt;code&gt;null&lt;/code&gt; is an &lt;code&gt;object&lt;/code&gt;. 😂 I know this is strange but this is how it was designed and we have to live with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Undefined
&lt;/h2&gt;

&lt;p&gt;This is another unusual and strange thing about JavaScript. If you declared a variable then it means that it exists but it's still considered &lt;code&gt;undefined&lt;/code&gt; unless you put a value into it. So basically it represents the state of a variable that's been declared but without a value assigned to it.&lt;/p&gt;

&lt;p&gt;The type of &lt;code&gt;undefined&lt;/code&gt; is &lt;code&gt;undefined&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="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="k"&gt;typeof&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 'undefined'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  6. Object
&lt;/h1&gt;

&lt;p&gt;An object is a collection of properties. The properties can be any of the previously mentioned types, as well as other objects and functions.&lt;/p&gt;

&lt;p&gt;It's a non-primitive data type and stores the values by reference. This is a very tricky part of the Objects.&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;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="o"&gt;===&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objects are created by reference so two &lt;code&gt;{}&lt;/code&gt; will always have two different references so they are never equal. This is another gotcha that you must watch out for.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comparison between different data types:
&lt;/h3&gt;

&lt;p&gt;Here are some quick and interesting comparisons&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;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="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&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="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&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="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&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="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&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="o"&gt;!&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&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="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// null&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="o"&gt;!!&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&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="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1&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="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// NaN&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks for reading! 🎈&lt;/p&gt;

</description>
      <category>devcommunity</category>
      <category>thetechnicalwritingbootcamp</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Variable Declaration in Javascript for Beginners</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Sun, 04 Oct 2020 20:56:47 +0000</pubDate>
      <link>https://forem.com/pankajsanam/variable-declaration-in-javascript-for-beginners-17k6</link>
      <guid>https://forem.com/pankajsanam/variable-declaration-in-javascript-for-beginners-17k6</guid>
      <description>&lt;p&gt;Variables in JavaScript are like containers that hold reusable data. These data containers need to be declared with some specific keywords in Javascript.&lt;/p&gt;

&lt;p&gt;Right now there are 3 ways to declare a keyword in JavaScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;var (older/outdated way)&lt;/li&gt;
&lt;li&gt;let (introduced in ES6 ✨)&lt;/li&gt;
&lt;li&gt;const (introduced in ES6 ✨)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before the standardization of ES6 (ES2015), everyone used to declare variables with the &lt;code&gt;var&lt;/code&gt; keyword. Now we have &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; for every possible case.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rules for using const and let
&lt;/h3&gt;

&lt;p&gt;Follow these two rules to decide:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use &lt;code&gt;const&lt;/code&gt; as a constant when you are sure that the variable will not be redeclared.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;let&lt;/code&gt; for everything else.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Rules for naming variables
&lt;/h3&gt;

&lt;p&gt;Variable names are case sensitive, so &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;Name&lt;/code&gt; both will be considered different variables.&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pankaj&lt;/span&gt;&lt;span class="dl"&gt;'&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;Name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Batman&lt;/span&gt;&lt;span class="dl"&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;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 'Pankaj'&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;Name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 'Batman'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variable names cannot begin with a number but the numbers can be used in the middle and end of the variable name.&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="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;name1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;my1name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pankaj&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A variable declared with &lt;code&gt;const&lt;/code&gt; must be initialized.&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="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// SyntaxError: missing initializer&lt;/span&gt;

&lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Pankaj&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;Variables &lt;strong&gt;can&lt;/strong&gt; start, end, or contain the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Uppercase strings&lt;/li&gt;
&lt;li&gt;Lowercase strings&lt;/li&gt;
&lt;li&gt;Underscores &lt;code&gt;_&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Dollar sign &lt;code&gt;$&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&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;_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;$name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;my_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;my$name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables &lt;strong&gt;cannot&lt;/strong&gt; start, end, or contain symbols and special characters:&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;my&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiple variables can be chained by comma, but it's not considered good practice to do 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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ invalid&lt;/span&gt;

&lt;span class="c1"&gt;// ✔ valid with let, const and var&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&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;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;b&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;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Subsequent declaration of a variable is possible with &lt;code&gt;var&lt;/code&gt; but not with &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&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="c1"&gt;// ✔ valid&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;81&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;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 81&lt;/span&gt;

&lt;span class="c1"&gt;// ❌ invalid for let and const&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;81&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// SyntaxError: Identifier 'age' has already been declared&lt;/span&gt;

&lt;span class="c1"&gt;// ✔ valid for var and let&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;81&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;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 81&lt;/span&gt;

&lt;span class="c1"&gt;// ❌ invalid for const&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hulk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Thor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Uncaught TypeError: Assignment to constant variable.&lt;/span&gt;

&lt;span class="c1"&gt;// ✔ valid for let, var, and const if the variable is an object/array&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hero&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;span class="nx"&gt;hero&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Thor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hero&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="s1"&gt;Hulk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;hero&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Thor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✔&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice in the above last example that we are just modifying one of the keys in the object and not replacing the entire object so it's working perfectly fine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should we prefer let and const over var
&lt;/h3&gt;

&lt;p&gt;It is good practice to avoid using &lt;code&gt;var&lt;/code&gt; declaration in your code. &lt;code&gt;let&lt;/code&gt; was introduced to provide a &lt;em&gt;level of organization&lt;/em&gt; while managing the large data structures as it is safer knowing that your variable cannot be reassigned anywhere in its scope.&lt;/p&gt;

&lt;h4&gt;
  
  
  A quick tip
&lt;/h4&gt;

&lt;p&gt;End all your statements with a semicolon. Although, JavaScript will do it for you when reading your code. But as a general guideline, we should always terminate each statement with a semicolon.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 🎉&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>thetechnicalwritingbootcamp</category>
      <category>variables</category>
    </item>
    <item>
      <title>Why should you learn JavaScript?</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Sun, 04 Oct 2020 20:51:11 +0000</pubDate>
      <link>https://forem.com/pankajsanam/why-should-you-learn-javascript-1b8g</link>
      <guid>https://forem.com/pankajsanam/why-should-you-learn-javascript-1b8g</guid>
      <description>&lt;p&gt;JavaScript is a loosely typed, interpreted scripting language. It is one of the most powerful and popular programming languages in the world.&lt;/p&gt;

&lt;p&gt;Most of the websites today are using Javascript. It is literally hard to imagine the &lt;em&gt;World Wide Web&lt;/em&gt; today without JavaScript. It's everywhere because all the browsers and devices support JavaScript nowadays.&lt;/p&gt;

&lt;p&gt;Initially, JavaScript was only available for creating simple user interactions on the websites but it evolved so much that it has gone beyond the web. Now you can do the following things with JavaScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Web development&lt;/li&gt;
&lt;li&gt;Mobile app development&lt;/li&gt;
&lt;li&gt;Desktop app development&lt;/li&gt;
&lt;li&gt;VR and Game development&lt;/li&gt;
&lt;li&gt;Machine learning&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Due to such a wide scope, there is an enormous amount of opportunities and possibilities with JavaScript. You can literally build anything with it. It has a huge job market for the same reason. Good and decent JavaScript developers are always in demand. 😉&lt;/p&gt;

&lt;h3&gt;
  
  
  What benefits JavaScript offers
&lt;/h3&gt;

&lt;p&gt;There are some major benefits offered by JavaScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It's free and easy to learn. (Except few gotchas 😈)&lt;/li&gt;
&lt;li&gt;It helps you to create beautiful, interactive, and fast user interfaces.&lt;/li&gt;
&lt;li&gt;You don't have to wait for an entire page to refresh while you interact with something on the page. It only loads the required part of the page without refreshing the entire page.&lt;/li&gt;
&lt;li&gt;Build websites, mobile, and desktop apps with Javascript so you don't have to learn the different languages for different platforms.&lt;/li&gt;
&lt;li&gt;Huge ecosystem of frameworks and libraries to choose from, which saves a lot of time and effort.&lt;/li&gt;
&lt;li&gt;Very large community of developers who are ready to help. They are constantly writing articles and tutorials related to Javascript from basic to advanced topics.&lt;/li&gt;
&lt;li&gt;Ecma International makes sure that the JavaScript standards are always updating and improving to make the web more performant and interactive. They are releasing new features and improvements every year.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You have a wide range of frameworks to choose from, for your choice of platform:&lt;/p&gt;

&lt;h4&gt;
  
  
  ⚒ For backend
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Node&lt;/li&gt;
&lt;li&gt;Express&lt;/li&gt;
&lt;li&gt;Hapi&lt;/li&gt;
&lt;li&gt;Koa&lt;/li&gt;
&lt;li&gt;Nest&lt;/li&gt;
&lt;li&gt;Deno&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  🎨 For frontend
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Vue js&lt;/li&gt;
&lt;li&gt;React js&lt;/li&gt;
&lt;li&gt;Svelte&lt;/li&gt;
&lt;li&gt;Quasar&lt;/li&gt;
&lt;li&gt;Angular&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  📱 For mobile apps
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;React Native&lt;/li&gt;
&lt;li&gt;Native Script&lt;/li&gt;
&lt;li&gt;Quasar&lt;/li&gt;
&lt;li&gt;Meteor&lt;/li&gt;
&lt;li&gt;Ionic&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  💻 For desktop apps
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Electron&lt;/li&gt;
&lt;li&gt;Quasar&lt;/li&gt;
&lt;li&gt;Proton Native&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  👓 For virtual reality
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;React VR&lt;/li&gt;
&lt;li&gt;A-frame&lt;/li&gt;
&lt;li&gt;WebXR&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  🎮 For games
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;PhaserJS&lt;/li&gt;
&lt;li&gt;PixiJS&lt;/li&gt;
&lt;li&gt;MelonJS&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  🧩 For machine learning
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;TensorFlow.js&lt;/li&gt;
&lt;li&gt;Brain.js&lt;/li&gt;
&lt;li&gt;Keras.js&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;👑 A single language rules them all. JavaScript is the future as it's constantly growing and improving with bleeding-edge features. It is definitely worth learning so you can build great stuff.&lt;/p&gt;

&lt;p&gt;You must have seen different articles with titles like these:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Should I learn Javascript in 2019&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Should I learn Javascript in 2020&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Trust me you would see the same after 10 years:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Should I learn Javascript in 2030&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let me say this once and for all - Javascript is worth learning as long as the Web exists and the &lt;em&gt;Web&lt;/em&gt; will exist and evolve as long as the human race exists.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should you not learn JavaScript
&lt;/h3&gt;

&lt;p&gt;We have all the good reasons to learn it but there has to be something that would want you to &lt;strong&gt;not&lt;/strong&gt; learn it. There are, actually, two reasons to &lt;strong&gt;not&lt;/strong&gt; learn it. I would strongly suggest to never learn JavaScript if:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You are living in a cave without the internet and planning to stay there for the rest of your life.&lt;/li&gt;
&lt;li&gt;You know that the world would be destroyed by &lt;em&gt;Thanos/Aliens/Super-Villains&lt;/em&gt; someday.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, it's up to you.&lt;/p&gt;

&lt;p&gt;Thanks for reading. 🎉&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>coding</category>
      <category>thetechnicalwritingbootcamp</category>
    </item>
    <item>
      <title>History of JavaScript - How it came into the existence</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Sun, 04 Oct 2020 20:43:34 +0000</pubDate>
      <link>https://forem.com/pankajsanam/history-of-javascript-how-it-came-into-the-existence-1oj3</link>
      <guid>https://forem.com/pankajsanam/history-of-javascript-how-it-came-into-the-existence-1oj3</guid>
      <description>&lt;p&gt;Javascript is a powerful scripting language. It was mainly developed for improving the interactions on web pages. But it has evolved so massively that it can now be used for mobile and desktop applications along with web applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who created Javascript
&lt;/h2&gt;

&lt;p&gt;Javascript was created within 10 days in May 1995 by &lt;strong&gt;Brendan Eich&lt;/strong&gt;. He worked as a Netscape Engineer at that time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it got its name
&lt;/h2&gt;

&lt;p&gt;Javascript was initially named &lt;em&gt;Mocha&lt;/em&gt; but it was officially called &lt;em&gt;LiveScript&lt;/em&gt; when first shipped as part of the Navigator 2.0 beta release in September 1995. But three months later, after receiving a Sun trademark, the name was changed to &lt;em&gt;JavaScript&lt;/em&gt; in Netscape Navigator 2.0 beta 3 release.&lt;/p&gt;

&lt;p&gt;Naming it &lt;em&gt;JavaScript&lt;/em&gt; was a &lt;em&gt;marketing tactic&lt;/em&gt; by Netscape to give the impression that &lt;em&gt;JavaScript&lt;/em&gt; was a spin-off of Java since Java was very popular among developers at that time. However, these two languages are not related to each other at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why was JavaScript created?
&lt;/h2&gt;

&lt;p&gt;It was created to add animations and user interactions to make websites dynamic. Netscape wanted to be ahead of the game by introducing this in its browser so they came up with this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Standardization of JavaScript
&lt;/h2&gt;

&lt;p&gt;In November 1996, Netscape submitted JavaScript to ECMA (European Computer Manufacturers Association), as the starting point for a standard specification that all browser vendors could follow.&lt;/p&gt;

&lt;p&gt;They had a technical committee that came up with &lt;em&gt;ECMA-262&lt;/em&gt; for standardizing the syntax and semantics to provide a vendor-neutral scripting language. This committee had developers from Netscape Communications, Microsoft, Sun Microsystems, and many other companies.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;ECMA&lt;/em&gt; was expanded beyond Europe so they changed their name to &lt;em&gt;Ecma International&lt;/em&gt; where &lt;em&gt;Ecma&lt;/em&gt; is a name and not an acronym anymore. They are responsible for the development and upkeep of the language to this day. As a result, the scripting language was officially given the name &lt;strong&gt;ECMAScript&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  ECMAScript Timeline
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 1 (June 1997):&lt;/strong&gt; First version of the standard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 2 (June 1998):&lt;/strong&gt; Small update to keep these standards in sync with the ISO standard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 3 (December 1999):&lt;/strong&gt; Added many core features like regular expressions, try/catch exception handling, better string handling, do-while, switch, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 4 (abandoned in July 2008):&lt;/strong&gt; A massive upgrade with static typing, modules, namespaces, etc, but it was never finalized and got abandoned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 5 (December 2009):&lt;/strong&gt; Added minor improvements along with JSON support, strict mode, and some array methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 5.1 (June 2011):&lt;/strong&gt; Small update to keep Ecma and ISO standards in sync.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 6 (June 2015):&lt;/strong&gt; A large update that took a lot of things from the abandoned ECMAScript 4. This was the first version that used the year of publication as its official name - ECMAScript 2015. It added a lot of features like classes, promises, arrow functions, default parameter values, let/const, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 2016 (June 2016):&lt;/strong&gt; First yearly release with few improvements and new features like exponential operator.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 2017 (June 2017):&lt;/strong&gt; Second yearly release with new features like string padding, async functions, shared memory, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 2018 (June 2018):&lt;/strong&gt; New features like asynchronous iteration, Promise.finally, rest/spread operators for object literals, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 2019 (June 2019):&lt;/strong&gt; New features and some changes in Array and Object prototypes and stability improvement in Array.sort.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECMAScript 2020 (June 2020):&lt;/strong&gt; New features that include a BigInt primitive for arbitrary-sized integers, new null coalescing syntax, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ecma Technical Committee 39 (TC39)
&lt;/h2&gt;

&lt;p&gt;TC-39 is a group of people who are responsible for the standards. They have meetings every two months with member-appointed delegates and invited experts. You can check the minutes of those meetings here &lt;a href="https://github.com/tc39/notes"&gt;GitHub repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also check the proposed features and their stages here &lt;a href="https://github.com/tc39/proposals"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With each ECMAScript release, there are few important points to note-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;New versions are always backward compatible except few occasional minor cleanups which are hardly noticeable.&lt;/li&gt;
&lt;li&gt;Old features aren’t removed or fixed. Instead, better versions of them are introduced. For example, let and const were introduced but var wasn't removed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keeping old stuff is important here. If a new version is created without any backward compatibility then a lot of work will be required to migrate all these billions of projects and sites. This would wreak havoc and break the entire internet.😁&lt;/p&gt;

&lt;p&gt;I hope you found this history interesting.&lt;/p&gt;

&lt;p&gt;Watch out for more articles coming in this &lt;strong&gt;Javascript Basics&lt;/strong&gt; series.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>thetechnicalwritingbootcamp</category>
      <category>programming</category>
      <category>coding</category>
    </item>
    <item>
      <title>Free your blocked ports on Linux</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Sun, 23 Aug 2020 15:36:57 +0000</pubDate>
      <link>https://forem.com/pankajsanam/free-your-blocked-ports-on-linux-7d2</link>
      <guid>https://forem.com/pankajsanam/free-your-blocked-ports-on-linux-7d2</guid>
      <description>&lt;p&gt;You closed all your code editors and terminals but your ports are still &lt;em&gt;blocked&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The only solution you would have in your mind as a beginner is, to restart the computer. That would definitely fix this.&lt;/p&gt;

&lt;p&gt;But what if there is a better way?&lt;/p&gt;

&lt;p&gt;What if I can check where my port is being used and close that application, rather than restarting the computer?&lt;/p&gt;

&lt;p&gt;For example, my blocked port is 3005 and I would like to see which application is still using it. I would simply run this in my terminal-&lt;/p&gt;

&lt;p&gt;&lt;code&gt;lsof -i :3005&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This would give an output with a table of all the programs using this port 3005. Notice the PID column there and note down its value. In my case, it was 6595.&lt;/p&gt;

&lt;p&gt;Now run the following command to kill the process and free the port from this evil app-&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kill 6595&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now run your project on that port and live happily ever after.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LpLYvBJo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cf6hqto773ck1pqeer0v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LpLYvBJo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cf6hqto773ck1pqeer0v.png" alt="Free Ports"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Closing Notes
&lt;/h3&gt;

&lt;p&gt;This is not a very frequent problem but can be frustrating for beginners and developers who are not proficient in Linux.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>troubleshooting</category>
      <category>terminal</category>
    </item>
    <item>
      <title>What's your definition of success?</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Tue, 04 Aug 2020 11:35:38 +0000</pubDate>
      <link>https://forem.com/pankajsanam/what-s-your-definition-of-success-4ang</link>
      <guid>https://forem.com/pankajsanam/what-s-your-definition-of-success-4ang</guid>
      <description>&lt;p&gt;The meaning of success can be different for everybody.&lt;/p&gt;

&lt;p&gt;I would consider myself successful when I have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Financial freedom&lt;/li&gt;
&lt;li&gt;Automated income&lt;/li&gt;
&lt;li&gt;Enough savings and investment&lt;/li&gt;
&lt;li&gt;Work from anywhere&lt;/li&gt;
&lt;li&gt;Healthy lifestyle&lt;/li&gt;
&lt;li&gt;Work-free weekends&lt;/li&gt;
&lt;li&gt;More family time&lt;/li&gt;
&lt;li&gt;More travel&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you give enough thought on these points, you would realize that the following two points can help in achieving the rest:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Automated income&lt;/li&gt;
&lt;li&gt;Work from anywhere&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I haven't achieved any of the above yet. Once I do, I shall consider myself successful.&lt;/p&gt;

&lt;p&gt;So what's your definition of success?&lt;/p&gt;

&lt;p&gt;Do you think you are already successful? Or do you think you are close enough/far-away?&lt;/p&gt;

</description>
      <category>life</category>
      <category>success</category>
      <category>watercooler</category>
      <category>discuss</category>
    </item>
    <item>
      <title>What do you think about my new domain?</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Thu, 16 Jul 2020 03:07:41 +0000</pubDate>
      <link>https://forem.com/pankajsanam/what-do-you-think-about-my-new-domain-3d45</link>
      <guid>https://forem.com/pankajsanam/what-do-you-think-about-my-new-domain-3d45</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kyf2IndM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nh0lm5u84qxq6b3lb392.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kyf2IndM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nh0lm5u84qxq6b3lb392.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey guys 👋🏼,&lt;/p&gt;

&lt;p&gt;I hope you all are doing great.&lt;/p&gt;

&lt;p&gt;I just bought a domain: desk.sh&lt;/p&gt;

&lt;p&gt;I don't know but I was compelled to grab it as soon as I saw it. It's short, memorable and can fit with different niches from tech to non-tech material.&lt;/p&gt;

&lt;p&gt;I wonder what you guys think about this? Do you like this short name? What can I possibly do with this other than using it as my new secondary email?&lt;/p&gt;

&lt;p&gt;I'm exploring different options at the moment and your valuable thoughts on this would be much appreciated.&lt;/p&gt;

&lt;p&gt;Thanks 🙏🏼&lt;/p&gt;

</description>
      <category>domain</category>
      <category>idea</category>
    </item>
    <item>
      <title>My browser journey from 2007</title>
      <dc:creator>Pankaj</dc:creator>
      <pubDate>Thu, 09 Jul 2020 04:51:35 +0000</pubDate>
      <link>https://forem.com/pankajsanam/my-browser-journey-from-2007-216o</link>
      <guid>https://forem.com/pankajsanam/my-browser-journey-from-2007-216o</guid>
      <description>&lt;p&gt;Ben posted about making a switch to the Firefox browser. However, he felt weird to be off from Chrome.&lt;/p&gt;

&lt;p&gt;Last month I also made a switch so I know that feeling of switching away from Chrome.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/ben" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1%2Ff451a206-11c8-4e3d-8936-143d0a7e65bb.png" alt="ben"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/ben/i-m-still-using-firefox-11p" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;I'm still using Firefox&lt;/h2&gt;
      &lt;h3&gt;Ben Halpern ・ Jul 6 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#browsers&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#watercooler&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Ben's post got me to revisit my old memories and my entire browser journey.&lt;/p&gt;

&lt;p&gt;This all started when I got my first computer in 2007. I had zero knowledge and understanding of how computers worked. I think I have used Internet Explorer for a lot of these initial years.&lt;/p&gt;

&lt;p&gt;I slowly learned how to use it and finally got a dial-up internet connection in 2008.  I also explored other browsers like Maxthon, SeaMonkey, Opera.&lt;/p&gt;

&lt;p&gt;So this is how it started-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Internet Explorer (Used it in the beginning)&lt;/li&gt;
&lt;li&gt;Opera (1 year)&lt;/li&gt;
&lt;li&gt;Firefox (3 years)&lt;/li&gt;
&lt;li&gt;Chrome (5 years)&lt;/li&gt;
&lt;li&gt;Edge (Currently using)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I just started using the new Edge browser last month when I read a tweet from Sarthak.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1273337590964346880-553" src="https://platform.twitter.com/embed/Tweet.html?id=1273337590964346880"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1273337590964346880-553');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1273337590964346880&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;So I tweeted this and started using it-&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1273457814149541889-888" src="https://platform.twitter.com/embed/Tweet.html?id=1273457814149541889"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1273457814149541889-888');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1273457814149541889&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;To my wonders, I found Edge to be much better and faster than Chrome. I can use the same amount of extensions and browsing tabs on Edge which could lag my Chrome experience like crazy.&lt;/p&gt;

&lt;p&gt;So bye-bye Chrome! And Hello Edge!&lt;/p&gt;

</description>
      <category>browser</category>
      <category>edge</category>
      <category>chrome</category>
      <category>firefox</category>
    </item>
  </channel>
</rss>
