<?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: Bhaveek Jain</title>
    <description>The latest articles on Forem by Bhaveek Jain (@bhaveek424).</description>
    <link>https://forem.com/bhaveek424</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%2F718827%2Febc3f791-54a6-411d-ab4b-421cb4a65b86.jpeg</url>
      <title>Forem: Bhaveek Jain</title>
      <link>https://forem.com/bhaveek424</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bhaveek424"/>
    <language>en</language>
    <item>
      <title>const a = [ ] is not an array?! 😱</title>
      <dc:creator>Bhaveek Jain</dc:creator>
      <pubDate>Sat, 24 Dec 2022 15:55:14 +0000</pubDate>
      <link>https://forem.com/bhaveek424/const-a-is-not-an-array-3obb</link>
      <guid>https://forem.com/bhaveek424/const-a-is-not-an-array-3obb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As I delved into &lt;a href="https://twitter.com/ThePrimeagen" rel="noopener noreferrer"&gt;Primeagen's&lt;/a&gt; &lt;a href="https://frontendmasters.com/courses/algorithms/" rel="noopener noreferrer"&gt;Algorithms&lt;/a&gt; course on &lt;a href="https://frontendmasters.com/" rel="noopener noreferrer"&gt;Frontend Masters&lt;/a&gt;, I was struck by a revelation: the familiar &lt;code&gt;const a = [ ]&lt;/code&gt; syntax we use to declare an array in JavaScript is not, in fact, an array in the traditional sense. This discovery came as a surprise to me, and I felt a desire to share this newfound knowledge with others through this blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Array?
&lt;/h2&gt;

&lt;p&gt;An array is an ordered collection of values. Each value is called an element, and each element has a numeric position in the array, known as its index. JavaScript arrays are untyped: an array element may be of any type, and different elements of the same array may be of different types. Array elements may even be objects or other arrays, which allows you to create complex data structures, such as arrays of objects and arrays of arrays. JavaScript arrays may be sparse: the elements need not have contiguous indexes, and there may be gaps. Every JavaScript array has a length property. For nonsparse arrays, this property specifies the number of elements in the array. For sparse arrays, length is larger than the highest index of any element. JavaScript arrays are a specialized form of JavaScript object, and array indexes are really little more than property names that happen to be integers. JavaScript arrays are dynamic: they grow or shrink as needed, and there is no need to declare a fixed size for the array when you create it or to reallocate it when the size changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Proof!
&lt;/h2&gt;

&lt;p&gt;Let's write some code for the empirical test and find out under the hood, what type of data structure is &lt;strong&gt;const a = [ ]&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;P.S&lt;/strong&gt;: I'll be using &lt;a href="https://www.typescriptlang.org/" rel="noopener noreferrer"&gt;TypeScript&lt;/a&gt; for this proof so I have type safety.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can find the code in the &lt;a href="https://github.com/bhaveek424/array-test" rel="noopener noreferrer"&gt;github repo&lt;/a&gt; for reference or you can copy it from below and work it out on your own machine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&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="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;number&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;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &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;i&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &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;i&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &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;i&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &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;i&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;push_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&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="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;pop_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&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="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;unshift_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&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="nf"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;shift_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&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="nf"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&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;Let's summarize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create an array&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;function &lt;code&gt;time:&lt;/code&gt; to measure the time of function&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We just want a gauge of how fast or slow things are.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;function &lt;code&gt;unshift&lt;/code&gt; : it will unshift " &lt;strong&gt;a "&lt;/strong&gt; a certain amount of times&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift" rel="noopener noreferrer"&gt;&lt;strong&gt;unshift&lt;/strong&gt;&lt;/a&gt; in javascript means adding to a list&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;function &lt;code&gt;shift&lt;/code&gt; will shift "&lt;strong&gt;a"&lt;/strong&gt; a certain number of times&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift" rel="noopener noreferrer"&gt;shift&lt;/a&gt; is used for removing from the beginning of the list&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;function &lt;code&gt;push&lt;/code&gt; will push "&lt;strong&gt;a"&lt;/strong&gt; a certain number amount of time.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;push method is used to add one or more elements to the end of an array&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;function &lt;code&gt;pop&lt;/code&gt; will pop "&lt;strong&gt;a"&lt;/strong&gt; a certain number of times.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop" rel="noopener noreferrer"&gt;&lt;strong&gt;pop&lt;/strong&gt;&lt;/a&gt; method is used to remove the last element from an array and returns that element.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;function &lt;code&gt;get&lt;/code&gt; based on index. Just in case it is a LinkedList under the hood, if we were to get progressively larger indices, we should see a linear slowdown.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;functions &lt;code&gt;push_arr&lt;/code&gt;, &lt;code&gt;pop_arr&lt;/code&gt;, &lt;code&gt;shift_arr&lt;/code&gt;, &lt;code&gt;unshift_arr&lt;/code&gt; are higher-order functions that will call &lt;code&gt;push&lt;/code&gt;, &lt;code&gt;pop&lt;/code&gt;, &lt;code&gt;shift&lt;/code&gt; and &lt;code&gt;unshift&lt;/code&gt; functions repeatedly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;then comes the tests ...&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tests
&lt;/h2&gt;

&lt;p&gt;Now we will test our functions and try to figure out what the results indicate&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro-tip&lt;/strong&gt;: Whenever we are doing a &lt;em&gt;performance&lt;/em&gt; test, you should use a step ladder-type approach that way you can see how it grows so you can run a linear regression.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tests&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="nx"&gt;_000_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="nx"&gt;_000_000&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="nf"&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;Testing get&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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="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="nf"&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;push&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;push_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&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="nf"&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;pop&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pop_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&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="nf"&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;unshift&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;unshift_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&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="nf"&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;shift&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;tests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;shift_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&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;Let's summarize:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We are gonna test with 10, 100, 100 .... 10000000 elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In first test, "Testing get", we are going to &lt;code&gt;push&lt;/code&gt; in the value and do a &lt;code&gt;get&lt;/code&gt; for the last element&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The thesis here is, if indexing is linear, we should see a slowdown as the array gets bigger&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the second test, "push", we are going to &lt;code&gt;push&lt;/code&gt; a thousand items after growing to a certain length &lt;code&gt;t.&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If &lt;strong&gt;push&lt;/strong&gt; is based on the number of items within the array, we should theoretically see a slowdown that happens. So it should be linearly getting slower at every single step.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The same thesis is for "pop", "shift" and "unshift" tests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Its time to run our code and check how the results pan out and in what direction are we going when we talk about arrays in javascript&lt;/p&gt;

&lt;p&gt;As this is &lt;strong&gt;TypeScript,&lt;/strong&gt; run &lt;code&gt;npx ts-node {file-name}.ts&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Testing Get
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1iaksyoa0isbkmj8wxay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1iaksyoa0isbkmj8wxay.png" alt="get" width="745" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Doesn't matter the size of the array. It's super duper fast.&lt;/p&gt;

&lt;h4&gt;
  
  
  Testing push
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1671892972780%2F019146c0-4e62-4c76-bad6-589cbf920191.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1671892972780%2F019146c0-4e62-4c76-bad6-589cbf920191.png" alt="push" width="743" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Same case as &lt;strong&gt;get, it'&lt;/strong&gt;s quite fast.&lt;/p&gt;

&lt;h4&gt;
  
  
  Testing pop
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlfby0ek4drld97vu532.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlfby0ek4drld97vu532.png" alt="pop" width="742" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similar results as &lt;strong&gt;get&lt;/strong&gt; and &lt;strong&gt;push,&lt;/strong&gt; it's quite fast.&lt;/p&gt;

&lt;h4&gt;
  
  
  Testing unshift and shift
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F989jg72u7davsh6yrsh2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F989jg72u7davsh6yrsh2.png" alt="unshift" width="742" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we observe that the test cases get horribly slow and is having a linear growth.&lt;/p&gt;

&lt;p&gt;So what do we infer from these results:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8t6f6vccs6i7hl6o8v84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8t6f6vccs6i7hl6o8v84.png" alt="results" width="800" height="129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Instant access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Instant pushing and popping at the end&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linear shifting and un-shfting&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hence it's an &lt;strong&gt;ArrayList&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An array list is a data structure that is similar to an array, but it has a dynamic size and allows you to add and remove elements more efficiently. Array lists are commonly used in programming languages to store and manipulate a collection of items.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We can safely conclude that Javascript arrays are dynamic and it's actually &lt;strong&gt;ArrayLists&lt;/strong&gt; under the hood.&lt;/p&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/ThePrimeagen" rel="noopener noreferrer"&gt;ThePrimeAgen&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Thank you for reading this blog. I hope that you have found this information helpful and if you liked it, consider sharing it with others also.&lt;/p&gt;

&lt;p&gt;Bye!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>vscode</category>
      <category>browser</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Top 5 mistakes to avoid when using React with Typescript</title>
      <dc:creator>Bhaveek Jain</dc:creator>
      <pubDate>Wed, 21 Dec 2022 18:43:18 +0000</pubDate>
      <link>https://forem.com/bhaveek424/top-5-mistakes-to-avoid-when-using-react-with-typescript-24e0</link>
      <guid>https://forem.com/bhaveek424/top-5-mistakes-to-avoid-when-using-react-with-typescript-24e0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Are you looking for a comprehensive introduction to using React with TypeScript? Look no further! In this blog, we'll delve into the top 5 mistakes to avoid when combining these powerful tools. As a JavaScript library, React allows developers to build reusable UI components and create efficient, dynamic user interfaces. When paired with TypeScript, a typed superset of JavaScript, developers can take advantage of enhanced type checking and improved code reliability. However, it's important to be mindful of potential pitfalls and mistakes that can arise during the development process. By following best practices and avoiding common errors, you can ensure a smooth and successful experience when using React with TypeScript. In this blog, we'll follow practical tips and helpful examples to guide you on your journey. &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Using Type "any"
&lt;/h2&gt;

&lt;p&gt;Typescript allows you to assign &lt;strong&gt;types&lt;/strong&gt; to variables. Usually, it's done in this way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;someNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;lets do some operations&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;someNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;someNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✅ All good&lt;/span&gt;
&lt;span class="nx"&gt;someNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ten&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌ Error&lt;/span&gt;
&lt;span class="c1"&gt;// Type 'string' is not assignable to type 'number'/. (2322) &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here when we assign our variable a &lt;code&gt;number&lt;/code&gt;, it worked fine but gave an error when provided it with a &lt;code&gt;string&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We can roughly describe &lt;strong&gt;types&lt;/strong&gt; as a collection of possible things that are similar in some way. For example, type &lt;code&gt;number&lt;/code&gt; contains numbers from 0.5,2,3 ... 1000 ... 122123 etc. You get the point that they are somewhat similar and have a specific behaviour like addition, subtraction etc. But there are also some operations that are not available for certain types, say for &lt;code&gt;number&lt;/code&gt; in our case, we can't really get a member of a number or &lt;code&gt;2[3]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So if we write this in typescript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;someNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tuff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;someNumber&lt;/span&gt;&lt;span class="p"&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;we'll receive this error&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kc7gnp55bnsjx8trfmk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8kc7gnp55bnsjx8trfmk.png" alt="any-error" width="800" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's modify our example a bit and see what impact it makes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;someNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tuff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;someNumber&lt;/span&gt;&lt;span class="p"&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;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdk75jsxdcc1oqgd6p77y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdk75jsxdcc1oqgd6p77y.png" alt="any-implementation" width="564" height="236"&gt;&lt;/a&gt;&lt;br&gt;
Suddenly, the errors are gone!&lt;/p&gt;

&lt;p&gt;Welcome to "any" land!&lt;br&gt;
The biggest problem with &lt;strong&gt;any&lt;/strong&gt; is that it's positive/permissive. It's similar to something if I say: "I drink something." You would assume I'm drinking something drinkable like lemonade or water. You wouldn't expect me drinking acid or petrol, in which case I'd need immediate medical attention(lol)&lt;/p&gt;

&lt;p&gt;Using the &lt;strong&gt;any&lt;/strong&gt; type can make your code less reliable and more prone to runtime errors, because the compiler is not able to catch type-related issues. It can also make your code less readable and maintainable, because it's not clear to other developers what the type of a value is.&lt;/p&gt;

&lt;p&gt;Instead of using the &lt;strong&gt;any&lt;/strong&gt; type, it's generally best to use explicit type annotations or type declarations to specify the types of values in your code. This will help ensure that your code is correctly typed and can be more easily understood by others.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Using Type Assertions
&lt;/h2&gt;

&lt;p&gt;Type assertions, also known as type casting, are a way to override the type of a value in TypeScript. While they can be useful in certain situations, it's generally recommended to avoid using type assertions in your code. This is because type assertions can mask type-related issues and hinder the effectiveness of the TypeScript compiler.&lt;/p&gt;

&lt;p&gt;For example, if you use a type assertion to tell the compiler that a value has a certain type, the compiler will trust your assertion and will not perform any further type checking on that value. This means that if there is a type mismatch or error in your code, it may not be caught by the compiler and could lead to runtime errors.&lt;/p&gt;

&lt;p&gt;Additionally, type assertions can make your code less readable and maintainable. They can obscure the actual type of a value and make it more difficult for other developers to understand your code.&lt;/p&gt;

&lt;p&gt;In general, it's best to let the TypeScript compiler do its job and catch type-related issues as early as possible in the development process. Instead of using type assertions, you can use type annotations or type declarations to explicitly specify the types of variables and values in your code. This will help ensure that your code is correctly typed and can be more easily understood by others.&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 typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;someValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;this is a string&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;strLength&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;someValue&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&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 a variable someValue with the type &lt;code&gt;any&lt;/code&gt;, which means it can hold any value. We then use a type assertion to tell the compiler that someValue is a &lt;code&gt;string&lt;/code&gt;, and we access the length property of the string.&lt;/p&gt;

&lt;p&gt;However, as mentioned earlier, it's generally recommended to avoid using type assertions like this. Instead, we could have explicitly declared the type of &lt;code&gt;someValue&lt;/code&gt; as a string, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;someValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;this is a string&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;strLength&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;someValue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach is more type-safe and makes it clearer to other developers what the type of &lt;code&gt;someValue&lt;/code&gt; is. It also allows the TypeScript compiler to catch any type-related issues that may arise.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Using @ts-ignore
&lt;/h2&gt;

&lt;p&gt;The @ts-ignore directive is a way to tell the TypeScript compiler to ignore a specific piece of code. It can be used to suppress type-related errors or warnings that the compiler generates.&lt;/p&gt;

&lt;p&gt;We declare @ts-node as a comment on the line we want to ignore to type check&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&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="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// @ts-ignore // Unreachable code block&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&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 ts-ignore&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;It's a good practise to provide a reason for why we are ignoring this.&lt;/p&gt;

&lt;p&gt;After we discussed how important it is to not use type &lt;code&gt;any&lt;/code&gt; and not use type assertions too much, it might be surprising that such option even exist.&lt;br&gt;
It can be useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In tests, when you want to verify that invalid inputs will be handled correctly&lt;/li&gt;
&lt;li&gt;When you are migrating to newer version of typescript&lt;/li&gt;
&lt;li&gt;When you are migrating javascript code base to typescript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While @ts-ignore can be useful in certain situations, it's generally not recommended to use it excessively in your code. This is because @ts-ignore can mask type-related issues and hinder the effectiveness of the TypeScript compiler.&lt;/p&gt;

&lt;p&gt;For example, if you use &lt;code&gt;@ts-ignore&lt;/code&gt; to suppress a type error, the compiler will not report the error and the issue will not be addressed. This can lead to runtime errors or unexpected behavior in your code.&lt;/p&gt;

&lt;p&gt;Additionally, using &lt;code&gt;@ts-ignore&lt;/code&gt; can make your code less maintainable and harder to understand, because it's not clear why the compiler is being told to ignore a certain piece of code.&lt;/p&gt;

&lt;p&gt;It's generally best to let the TypeScript compiler do its job and catch type-related issues as early as possible in the development process. Instead of using @ts-ignore, you can try to fix the underlying issue or use explicit type annotations or type declarations to specify the types of values in your code. This will help ensure that your code is correctly typed and can be more easily understood by others.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Using numeric enums
&lt;/h2&gt;

&lt;p&gt;An enum (short for "enumeration") is a way to define a set of named constants. Enums can be either numeric or string-based.&lt;/p&gt;

&lt;p&gt;Numeric enums are enums in which the values are numeric. In a numeric enum, the values are automatically assigned incrementing numbers starting from 0.&lt;/p&gt;

&lt;p&gt;Here is an example of a numeric enum in TypeScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;Days&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;Monday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Tuesday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Wednesday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Thursday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Friday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Saturday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Sunday&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;In&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="kr"&gt;enum&lt;/span&gt; &lt;span class="s2"&gt;`Days`&lt;/span&gt; &lt;span class="nx"&gt;has&lt;/span&gt; &lt;span class="nx"&gt;seven&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Monday`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Tuesday`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Wednesday`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Thursday`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Friday`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Saturday`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="s2"&gt;`Sunday`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;These&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="nx"&gt;are&lt;/span&gt; &lt;span class="nx"&gt;automatically&lt;/span&gt; &lt;span class="nx"&gt;assigned&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nx"&gt;through&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;respectively&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While numeric enums can be useful in certain situations, it's generally recommended to avoid using them in your TypeScript code. This is because numeric enums can be prone to errors and can make your code less readable and maintainable.&lt;/p&gt;

&lt;p&gt;One issue with numeric enums is that they can lead to runtime errors if you are not careful. For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;Days&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;Monday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Tuesday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Wednesday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Thursday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Friday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Saturday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;Sunday&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;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Days&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Monday&lt;/span&gt;&lt;span class="p"&gt;;&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;day&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;Days&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Sunday&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Today is Sunday&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="k"&gt;else&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Today is not Sunday&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;In this example, we have an enum &lt;code&gt;Days&lt;/code&gt; with seven values representing the days of the week. We then assign the value &lt;code&gt;Days.Monday&lt;/code&gt; to the variable day.&lt;/p&gt;

&lt;p&gt;However, because we are using a numeric enum, the values of the enum are automatically assigned incrementing numbers starting from 0. This means that the value of &lt;code&gt;Days.Monday&lt;/code&gt; is actually 0, and the value of &lt;code&gt;Days.Sunday&lt;/code&gt; is 6.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4i6lo3obvekptxhb3s5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn4i6lo3obvekptxhb3s5.png" alt="enumNumeric" width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a result, the condition in the if statement will evaluate to false, and the message "Today is not Sunday" will be logged to the console. This can be confusing and lead to unexpected behavior in your code.&lt;/p&gt;

&lt;p&gt;Another issue with numeric enums is that they can make your code less readable and maintainable. It's often not immediately clear what a numeric value represents in an enum, and it can be easy to mix up the values or use them incorrectly.&lt;/p&gt;

&lt;p&gt;For these reasons, it's generally recommended to use string-based enums instead of numeric enums in your TypeScript code. String-based enums provide better type safety and are easier to understand, which can make your code more reliable and maintainable.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Marking fields optional
&lt;/h2&gt;

&lt;p&gt;In TypeScript, you can use the &lt;code&gt;?&lt;/code&gt; symbol to mark a field or parameter as optional. This means that the field or parameter is not required and does not need to be provided when the code is called.&lt;/p&gt;

&lt;p&gt;While marking fields or parameters as optional can be useful in certain situations, it's generally not recommended to do so excessively. This is because optional fields and parameters can make your code less reliable and more prone to runtime errors.&lt;/p&gt;

&lt;p&gt;For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greet&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="kr"&gt;string&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello, &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;!`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;name&lt;/code&gt; parameter of the &lt;code&gt;greet&lt;/code&gt; function is marked as optional. This means that the function can be called without providing a value for &lt;code&gt;name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;However, if the function is called without a value for &lt;code&gt;name&lt;/code&gt;, the &lt;code&gt;console.log&lt;/code&gt; statement will result in an error, because the &lt;code&gt;name&lt;/code&gt; variable will be undefined. This can lead to unexpected behavior and runtime errors in your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gnujzakmy85hcf1awyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4gnujzakmy85hcf1awyx.png" alt="optional" width="800" height="170"&gt;&lt;/a&gt;&lt;br&gt;
To avoid this issue, it's generally best to make fields and parameters required by default, and only mark them as optional if there is a specific need to do so. This will help ensure that your code is more reliable and less prone to runtime errors.&lt;/p&gt;



&lt;br&gt;
Thank you for reading this blog. I hope that you have found this information helpful and that it will help you avoid common pitfalls and mistakes when working with these powerful tools.

&lt;p&gt;Using React with TypeScript can greatly improve the reliability and maintainability of your code, but it's important to be aware of potential issues and mistakes that can arise. By following best practices and avoiding these common errors, you can ensure a smooth and successful development process.&lt;/p&gt;

&lt;p&gt;If you have any further questions, comment it out and I'll try to answer in best possible way. Thanks for reading!&lt;/p&gt;

</description>
      <category>indonesia</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>Let's "Git" it: Beginners guide to Git</title>
      <dc:creator>Bhaveek Jain</dc:creator>
      <pubDate>Tue, 13 Dec 2022 16:08:22 +0000</pubDate>
      <link>https://forem.com/bhaveek424/lets-git-it-beginners-guide-to-git-1dkd</link>
      <guid>https://forem.com/bhaveek424/lets-git-it-beginners-guide-to-git-1dkd</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Are you new to Git and unsure of where to start? Look no further! Git is a popular version control system that allows you to track changes to your code and collaborate with others on your projects. In this blog, we will cover the basics of Git and provide a step-by-step guide on how to get started. You'll learn about the benefits of using Git, how to set up a repository, and how to commit and push changes to your code. By the end of this blog, you'll have a solid foundation in Git and be able to confidently incorporate it into your workflow. But first, let's answer this question...&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use Git?
&lt;/h2&gt;

&lt;p&gt;Git is a valuable tool for any developer, as it allows you to track changes to your code and collaborate with others on your projects. It also makes it easy to revert back to previous versions of your code if you make a mistake or want to experiment with different approaches. Additionally, Git provides a way to manage and organize your code, making it easier to keep track of your progress and share your work with others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Git
&lt;/h2&gt;

&lt;p&gt;To install git, you will need to have access to a terminal or command prompt. If you are using a Mac or Linux, the terminal is already installed on your system. If you are running a Windows machine, you can download it for free from &lt;a href="http://git-scm.com" rel="noopener noreferrer"&gt;http://git-scm.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm currently using Ubuntu 22.0.4, so the steps for setting and installing git are performed according to linux but it is more or less the same steps if you own a Windows or a Mac machine.&lt;/p&gt;

&lt;p&gt;Once you have access to a terminal or command prompt, follow these steps to install git:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the terminal or command prompt and type the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This will download and install git on your system. You may be prompted to enter your password to continue.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After git has been installed, you can verify the installation by typing the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20np1g5vmucu44q7fo3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20np1g5vmucu44q7fo3u.png" alt="git-version" width="738" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Running our first Git command
&lt;/h2&gt;

&lt;p&gt;So, we have Git up and running! Are you excited? Let's begin to type!&lt;/p&gt;

&lt;p&gt;You might be daunted by the jargon used by devs while working with git like "git commit it bro", "pull it", "git merge it to the main branch" etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewzdt54773sdlyz8oqvv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewzdt54773sdlyz8oqvv.jpg" alt="git-merge-meme" width="500" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can get an idea about these commands from git itself by typing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zxoq8kfg4lcs7ujijef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zxoq8kfg4lcs7ujijef.png" alt="git-help" width="800" height="628"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpblvhnuo8j9cemtc67up.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpblvhnuo8j9cemtc67up.png" alt="git-help" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up a new repository
&lt;/h3&gt;

&lt;p&gt;The first step is to set up a new repository (or repo, for short). A repo is a container for your entire project; every file or subfolder within it belongs to that repository, consistently. Physically, a repository is nothing other than a folder that contains a special .git folder, the folder where the magic happens.&lt;/p&gt;

&lt;p&gt;Let's try to make our first repo. Choose a folder you like, and type the &lt;code&gt;git init&lt;/code&gt; command, as shown here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1r86xntmrsyh7vu8lul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa1r86xntmrsyh7vu8lul.png" alt="git-init" width="759" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whoa! What just happened? Git created a &lt;code&gt;.git&lt;/code&gt; subfolder. At this point, it is not important for us to understand what is inside this folder. The only thing you have to know is that you do not have to touch it, ever! If you delete it or if you modify files inside by hand, you could get into trouble. Have I frightened you enough?&lt;/p&gt;

&lt;p&gt;Now that we have a repo, we can start to put files inside it. Git can trace the history of any gender of files, text-based or binary, small or large, with the same efficiency (more or less, large files are always a problem).&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding a File
&lt;/h3&gt;

&lt;p&gt;Let's create a text file just to give it a try.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fql39bjp13xu1tw9pcpg9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fql39bjp13xu1tw9pcpg9.png" alt="new-file" width="736" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now what? Is that all? No! We have to tell Git to put this file in your repo, explicitly. Git doesn't do anything that you don't want it to. If you have some spare files or temp ones in your repo, Git will not be compatible with them, but will only remind you that there are some files in your repo that are not under version control. You can also see the color of the &lt;code&gt;**master\&lt;/code&gt;** branch changed from green to brown, which indicates that I have some uncommitted files in my current repo. It happened because I'm &lt;a href="https://www.reddit.com/r/fishshell/comments/kns9y4/ayu_color_scheme_for_fish_shell/" rel="noopener noreferrer"&gt;ayu&lt;/a&gt; theme of fish shell.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;fish&lt;/strong&gt; is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions that just work, with no configuration required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok, back to the topic. I want &lt;code&gt;git.txt&lt;/code&gt; under the control of Git, so let's add it, as shown here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lbrehjjabdnv473xer6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lbrehjjabdnv473xer6.png" alt="add-command" width="736" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git add &amp;lt;file&amp;gt;&lt;/code&gt; command tells Git that we want it to take care of that file and check it for future modifications. Has Git obeyed us? Let's see.&lt;/p&gt;

&lt;p&gt;Using the git status command, we can check the status of the repo, as shown&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8h5bu9l5pzkwl3khhna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8h5bu9l5pzkwl3khhna.png" alt="git-status" width="736" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see, Git has accomplished its work as expected. In this image, we can read words such as branch, master, commit and unstage. We will look at them briefly, but for the moment, let's ignore them.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Commit"-ing the added file
&lt;/h3&gt;

&lt;p&gt;At this point, Git knows about &lt;code&gt;git.txt&lt;/code&gt;, but we have to perform another step to fix the snapshot of its content. We have to commit it using the appropriate git commit command. This time, we will add some flavor to our command, using the --message (or -m) subcommand, as shown here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh980ev7g2m69d2w0ipx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh980ev7g2m69d2w0ipx.png" alt="commit" width="736" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel the magic—a new branch is born!&lt;/p&gt;

&lt;p&gt;With the commit of &lt;code&gt;git.txt&lt;/code&gt;, we have finally fired up our repo. You can see the color has also changed back to green which means that our git is up to date.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modify a committed file
&lt;/h3&gt;

&lt;p&gt;Let's try to make some changes to the file and see how to deal with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8ljk7oorm3lqs5zo5cv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8ljk7oorm3lqs5zo5cv.png" alt="modify" width="736" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, the git status command informs us that there is a file with some modifications and that we need to commit it if we want to save this modification step in the repository history.&lt;/p&gt;

&lt;p&gt;However, what do no changes added to commit mean? It is simple. Git makes you take a second look at what you want to include in the next commit.&lt;/p&gt;

&lt;p&gt;If you have touched two files but you want to commit only one, you can add only that one. If you try to do a commit without skipping the add step, nothing will happen.&lt;/p&gt;

&lt;p&gt;So, let's add the file again for the purpose of getting things ready for the next commit&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxxd8uw8wocwrhf39z2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxxd8uw8wocwrhf39z2w.png" alt="add-again" width="736" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's do another commit, this time, avoiding the &lt;em&gt;--message&lt;/em&gt; subcommand. So, type &lt;code&gt;git commit&lt;/code&gt; and hit the &lt;code&gt;Enter&lt;/code&gt; key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xxk19lctb24n78fp8ul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xxk19lctb24n78fp8ul.png" alt="without-m" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have entered into a piece of code history! This is &lt;strong&gt;Vim&lt;/strong&gt; (&lt;strong&gt;Vi Improved&lt;/strong&gt;), an ancient and powerful text editor. You can configure Git to use your own preferred editor, but if you don't do it, this is what you have to deal with. Vim is powerful, but for newcomers, it can be a pain to use. It has a strange way of dealing with text, so to start typing, you have to press &lt;code&gt;i&lt;/code&gt; for inserting text or&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1670918630729%2FpBpSO1B1A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1670918630729%2FpBpSO1B1A.png" alt="i" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After writing the commit message press &lt;code&gt;Ctrl + c&lt;/code&gt; or &lt;code&gt;Esc&lt;/code&gt;to get out of insert mode and press &lt;code&gt;:wq&lt;/code&gt; to save and exit &lt;strong&gt;Vim.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15h3erqcjfc9t8ky3bdq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F15h3erqcjfc9t8ky3bdq.png" alt="exit" width="731" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that when you saved the commit message in Vim, Git automatically dispatches the commit work. Also see our master branch is green again :)&lt;/p&gt;

&lt;p&gt;Well done! Now, let's recap!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, you learned that Git is not so difficult to install.&lt;/p&gt;

&lt;p&gt;Once you have chosen a directory to include in a Git repository, you can see that initializing a new Git repository is as easy as executing a &lt;code&gt;git init&lt;/code&gt; command, and nothing more. Don't worry now about saving it on a remote server and so on. It's not mandatory to save it; you can do this when you need to, preserving the entire history of your repo. This is a killer feature of Git and DVCS in general. You can comfortably work offline and push your work to a remote location when the network is available, without hassle.&lt;/p&gt;

&lt;p&gt;In the end, we discovered one of the most important character traits of Git: it will do nothing if you don't mention it explicitly. You also learned a little bit about the add command. We were obliged to perform a &lt;code&gt;git add&lt;/code&gt; command for a file when we committed it to Git the very first time. Then, we used another command when we modified it. This is because if you modify a file, Git does not expect that you want it to be automatically added to the next commit.&lt;br&gt;
&lt;/p&gt;

&lt;br&gt;
If you liked this blog, consider following me &lt;a href="https://bhaveek.hashnode.dev/" rel="noopener noreferrer"&gt;here&lt;/a&gt; and on other social media platforms.

&lt;p&gt;&lt;a href="https://www.github.com/bhaveek424" rel="noopener noreferrer"&gt;Github&lt;/a&gt;, &lt;a href="https://www.twitter.com/jBhaveek" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/bhaveek/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bye!&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>react</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
