<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harshita Gupta</title>
    <description>The latest articles on DEV Community by Harshita Gupta (@harshitagupta).</description>
    <link>https://dev.to/harshitagupta</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%2F936005%2Fb0bfd879-e968-46f4-a28e-c89e332fe68d.jpeg</url>
      <title>DEV Community: Harshita Gupta</title>
      <link>https://dev.to/harshitagupta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harshitagupta"/>
    <language>en</language>
    <item>
      <title>What is JavaScript ? How is JS Code executed line by line?</title>
      <dc:creator>Harshita Gupta</dc:creator>
      <pubDate>Sat, 17 Jun 2023 11:53:40 +0000</pubDate>
      <link>https://dev.to/harshitagupta/what-is-javascript-how-is-js-code-executed-line-by-line-53po</link>
      <guid>https://dev.to/harshitagupta/what-is-javascript-how-is-js-code-executed-line-by-line-53po</guid>
      <description>&lt;p&gt;According to MDN Docs, a high level definition of JavaScript is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;JavaScript is a scripting or programming language that allows you to implement complex features on web pages.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Everything in JavaScript happens inside Execution Context. All the JavaScript code is executed inside it.&lt;/p&gt;

&lt;p&gt;The execution context is a big box that contains two components: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Memory Component/Variable Environment&lt;/li&gt;
&lt;li&gt;Code Component/Thread of Execution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Memory Component:&lt;/strong&gt; Here all the variables and functions are stored as key-value pairs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Component:&lt;/strong&gt; Here whole JS code is executed one line at a time.&lt;/p&gt;

&lt;p&gt;The above explanation makes us reach to this definition:&lt;br&gt;
&lt;em&gt;JavaScript is a &lt;strong&gt;Synchronous&lt;/strong&gt; &lt;strong&gt;Single-Threaded&lt;/strong&gt; language&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's break down the above definition by understanding these keywords:&lt;br&gt;
Synchronous: In a specific order&lt;br&gt;
Single-threaded: JavaScript can execute one command at a time. &lt;br&gt;
It can only go to the next line once the current line has been finished executing.&lt;/p&gt;

&lt;p&gt;Now let us understand how the execution context is created with the help of JavaScript program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;ans&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;square2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&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;square4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we run this whole code, a global execution context(GEC) is created. GEC is created in two phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Memory Creation Phase&lt;/li&gt;
&lt;li&gt;Code Execution Phase&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Memory Creation Phase&lt;/strong&gt;&lt;br&gt;
In this phase JavaScript will allocate memory to all the variables and functions.&lt;br&gt;
Memory allocation starts from line 1 and goes till line 7 of the above code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;As JS encounters line 1 it allocates memory to n. It stores a special value as undefined.&lt;/li&gt;
&lt;li&gt;It then see a function named square and allocation memory to variable square. Here it stores the whole code of the function inside this memory space.&lt;/li&gt;
&lt;li&gt;Similary it will allocate memory to square2 and square4 as undefined.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Memory Component&lt;/th&gt;
&lt;th&gt;Code Component&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;n: &lt;code&gt;undefined&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;square: (num){ &lt;br&gt; var ans = num * num &lt;br&gt; return ans &lt;br&gt;}&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;square2: &lt;code&gt;undefined&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;square4: &lt;code&gt;undefined&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Code Execution Phase&lt;/strong&gt;&lt;br&gt;
The code again runs from line 1 to 7 after the memory allocation phase is finished.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JS encounters line 1 and replaces n's value from undefined to 2&lt;/li&gt;
&lt;li&gt;Now from line 2 to 5 there is nothing to execute so it moves to line 6&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At line number 6 function is invoked, since function is a new mini program in itself so a new Execution Context is created.&lt;br&gt;
New execution context again has memory component and code component.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory Allocation Phase&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It allocates memory to num: undefined&lt;/li&gt;
&lt;li&gt;It allocates memory to ans: undefined&lt;/li&gt;
&lt;li&gt;No more functions or variables so memory allocation phase is completed.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Memory Component&lt;/th&gt;
&lt;th&gt;Code Component&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;num: &lt;code&gt;undefined&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ans: &lt;code&gt;undefined&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


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

&lt;p&gt;&lt;strong&gt;Code Execution Phase&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When function is invoked with argument n then in line 1 n=2 which is passed as parameter to the function&lt;/li&gt;
&lt;li&gt;In the next line num * num is calculated inside code component and put inside ans in memory component.&lt;/li&gt;
&lt;li&gt;Now it sees return ans. When JS encounters return it returns the control back to the execution context where the function was invoked.&lt;/li&gt;
&lt;li&gt;Now the control goes line 6 again.&lt;/li&gt;
&lt;li&gt;The whole execution context for this instance of square function will now be deleted.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YhoPIgOn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr2ov2e5rf37y4yezd9s.png" alt="alt text" width="309" height="165"&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now the square2 variable's undefined will be replaced with 4 (retuned as ans)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Similary function will be invoked on line 7 and pass 4 as argument which will return 16 (with all the above steps repeating in the same order).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Now JS is done with executing the whole code, now the whole Global execution context is deleted.&lt;br&gt;
This is how JavaScript code is executed line by line.&lt;/p&gt;

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

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>browser</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Changing tab-index with DOM Manipulation in React</title>
      <dc:creator>Harshita Gupta</dc:creator>
      <pubDate>Wed, 14 Jun 2023 18:30:47 +0000</pubDate>
      <link>https://dev.to/harshitagupta/changing-tab-index-with-dom-manipulation-in-react-2763</link>
      <guid>https://dev.to/harshitagupta/changing-tab-index-with-dom-manipulation-in-react-2763</guid>
      <description>&lt;p&gt;Before we go through the DOM manipulation, let us understand &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is DOM?&lt;/strong&gt;&lt;br&gt;
The Document Object Model (DOM) is the data representation of the objects that comprise the structure and content of a document on the web.&lt;br&gt;
It is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.&lt;/p&gt;

&lt;p&gt;Now let us understand &lt;strong&gt;Why need to change the tab-index?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Let us consider we have a Material UI DataGrid component&lt;/p&gt;

&lt;p&gt;As per WCAG guidelines, &lt;em&gt;the table and its rows are generally not keyboard focusable because they're not interactive elements.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the Material UI DataGrid component, first header column by default is keyboard focusable. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExcnU1c2NyYXJ2c2d6YTV5eGNrMzY5b2ZwZmV1OW15MG0yMnp3d3R3NSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/OLsDSMIu2Cja6ZLTMn/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExcnU1c2NyYXJ2c2d6YTV5eGNrMzY5b2ZwZmV1OW15MG0yMnp3d3R3NSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/OLsDSMIu2Cja6ZLTMn/giphy.gif" width="480" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In such scenarios we might need to explicitly change the tabIndex to -1 in order to change the make the application meets the accessibility criteria.&lt;/p&gt;

&lt;p&gt;You can better understand it with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;DataGrid&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@mui/x-data-grid&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;ul&gt;
&lt;li&gt;First fetch the elements using document.querySelector() of which we need to change the tab-index. &lt;/li&gt;
&lt;li&gt;document.querySelector() returns HTMLCollection as we have more than 1 element with class legend-color. &lt;/li&gt;
&lt;li&gt;Store this HTMLCollection in a variable named headerCell.&lt;/li&gt;
&lt;li&gt;Finally, we loop through headerCell, thus assigning tabIndex = -1 to each header cell which needs to be non-focusable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you wonder why we use setTimeout() then let me answer that for you. It may be possible that DOM might not have already loaded by the time script run. Thus, setTimeout() will ensure that once all the code is executed then we change the tabIndex.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;CustomDataGrid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;headerCell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;legend-color&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;headerCell&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;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="nx"&gt;headerCell&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;tabIndex&lt;/span&gt; &lt;span class="o"&gt;=&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="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="p"&gt;[])&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;columns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;field&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headerName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headerClassName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;header-id&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="na"&gt;field&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;firstName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headerName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;First name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headerClassName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;header-first-name&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="na"&gt;field&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lastName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headerName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Last Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;headerClassName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;header-last-name&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&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="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Harshita&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gupta&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="na"&gt;id&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="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Lannister&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Cersei&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;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;DataGrid&lt;/span&gt; 
    &lt;span class="na"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;columns&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
 &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Final results&lt;/strong&gt;&lt;br&gt;
Focus is removed from the first header column ID&lt;br&gt;
&lt;a href="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExeWdqcGRqMW9ya3Y5YnN6cnpnZ2w5eWxzdHZlemd0ZHFmODJ3ZHNrNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/H2iWIz661vQzDxKubw/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExeWdqcGRqMW9ya3Y5YnN6cnpnZ2w5eWxzdHZlemd0ZHFmODJ3ZHNrNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/H2iWIz661vQzDxKubw/giphy.gif" width="480" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Refer to the following sandbox for the code and implementation:&lt;br&gt;
&lt;a href="https://hctxgc.csb.app/"&gt;https://hctxgc.csb.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope this blog helped you.&lt;br&gt;
Thanks 👩‍💻&lt;/p&gt;

</description>
      <category>react</category>
      <category>a11y</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
