<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Code Entity RSS Feed]]></title><description><![CDATA[Javascript and Web Development tech blog! Here, you'll find the latest news and updates in the world of Javascript, as well as tutorials, projects and resources to help you improve your coding skills.]]></description><link>https://codeentity.tech</link><generator>GatsbyJS</generator><lastBuildDate>Sun, 09 Jul 2023 16:16:09 GMT</lastBuildDate><language><![CDATA[en]]></language><category><![CDATA[Web Development]]></category><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[HTML]]></category><category><![CDATA[CSS]]></category><category><![CDATA[Frontend]]></category><item><title><![CDATA[Understanding Scope and Context in JavaScript]]></title><description><![CDATA[When working with JavaScript, understanding the concepts of scope and context is crucial for writing clean and efficient code. `Scope` determines the accessibility of variables and functions, while `context` refers to the value of the `this` keyword, representing the current object within which a function is executed. In this blog post, we will delve into these concepts, providing real-life examples to illustrate their practical implications.]]></description><link>https://codeentity.tech/scope-and-context-js/</link><guid isPermaLink="false">https://codeentity.tech/scope-and-context-js/</guid><category><![CDATA[Javascript]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 12 May 2023 07:47:58 GMT</pubDate><content:encoded>&lt;p&gt;In JavaScript, &lt;code&gt;scope&lt;/code&gt; and &lt;code&gt;context&lt;/code&gt; are two different concepts that refer to different aspects of how variables and functions are accessed and used within the language.&lt;/p&gt;
&lt;h4&gt;Scope&lt;/h4&gt;
&lt;p&gt;Scope refers to the accessibility and visibility of &lt;code&gt;variables&lt;/code&gt;, &lt;code&gt;functions&lt;/code&gt;, and &lt;code&gt;objects&lt;/code&gt; in some particular part of your code during runtime. It determines where variables and functions are defined and where they can be accessed.
JavaScript has function scope and block scope, each with its unique characteristics.&lt;/p&gt;
&lt;h5&gt;Function Scope&lt;/h5&gt;
&lt;p&gt;Function scope refers to the accessibility of variables within a function and its nested functions. Variables declared with the &lt;code&gt;var&lt;/code&gt; keyword and functions declarations have function scope.
This means that you can access a variable or can call function anywhere in parent function regardless of where you have written it. Which is also called hoisting in JS.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you try to access a variable before value assignment which is generally where we declare it you will give undefined value.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;calculateTax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;50000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Accessed before declaration&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;calculateTax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;income&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;isRich&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// it will print undefined&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isRich&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;extraTax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4000&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;extraTax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;extraTax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// 4000 as variables declares with var have function scope&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;taxRate&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;income&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;taxRate&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;extraTax&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Tax to be paid: $&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tax&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;taxRate&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// ReferenceError: taxRate is not defined&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Block Scope&lt;/h5&gt;
&lt;p&gt;ES6 (ECMAScript 2015) introduced block scope with the &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; keywords. Variables declared with let and const have block scope, meaning they are accessible only within the block in which they are defined. (Typically in curly braces &lt;code&gt;{}&lt;/code&gt;)&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printNumbers&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// ReferenceError: i is not defined&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printNumbers&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, the variable &lt;code&gt;i&lt;/code&gt; is accessible within the &lt;code&gt;for&lt;/code&gt; loop’s &lt;code&gt;block&lt;/code&gt; but not outside of it.&lt;/p&gt;
&lt;h4&gt;Context&lt;/h4&gt;
&lt;p&gt;Context refers to the value of the &lt;code&gt;this&lt;/code&gt; keyword within a function, indicating the object to which the function belongs. Understanding &lt;code&gt;context&lt;/code&gt; is crucial when working with object-oriented JavaScript and dealing with method invocations.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;John&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hello, &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Hello, John&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the &lt;code&gt;greet&lt;/code&gt; function is defined within the &lt;code&gt;person&lt;/code&gt; object. When invoked using &lt;code&gt;person.greet()&lt;/code&gt;, the value of this refers to the person object, allowing access to its &lt;code&gt;name&lt;/code&gt; property.&lt;/p&gt;
&lt;p&gt;However, context can be easily misunderstood or lost, leading to unexpected results.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;John&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hello, &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Undefined&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this case, the this inside the setTimeout callback function does not refer to the &lt;code&gt;person&lt;/code&gt; object but to the &lt;code&gt;global&lt;/code&gt; object (e.g., window in browsers). Consequently, &lt;code&gt;this.name&lt;/code&gt; results in &lt;code&gt;undefined&lt;/code&gt;. To maintain the correct context, you can use arrow functions (In which &lt;code&gt;this&lt;/code&gt; refers to parent’s value of this) or explicitly bind the desired context using&lt;code&gt; bind()&lt;/code&gt; or &lt;code&gt;call()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let’s resolve this issue and access the name property of the person object correctly using both approaches:&lt;/p&gt;
&lt;h5&gt;Using an Arrow Function:&lt;/h5&gt;
&lt;p&gt;Arrow functions have &lt;code&gt;lexical&lt;/code&gt; scoping, meaning they &lt;code&gt;inherit&lt;/code&gt; the this value from their surrounding code. You can replace the regular function inside setTimeout with an arrow function to maintain the context of the person object.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;John&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hello, &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Hello, John&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By using an arrow function, the &lt;code&gt;this&lt;/code&gt; inside the arrow function will refer to the &lt;code&gt;this&lt;/code&gt; value of the surrounding &lt;code&gt;greet&lt;/code&gt; method, which is the person object.&lt;/p&gt;
&lt;h5&gt;Using Function Binding:&lt;/h5&gt;
&lt;p&gt;Another way to handle the context is by explicitly binding the desired context using the &lt;code&gt;bind()&lt;/code&gt; method. You can bind the &lt;code&gt;this&lt;/code&gt; value of the &lt;code&gt;greet&lt;/code&gt; method to the anonymous function inside setTimeout.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;John&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hello, &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Hello, John&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;greet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both approaches will output the desired result, printing “Hello, John” to the console after a delay of 1000 milliseconds.&lt;/p&gt;
&lt;p&gt;Finally, Understanding scope and context in JavaScript is crucial for writing clean and error-free code, particularly when dealing with asynchronous operations. It allows you to control how variables and functions are accessed and how objects are referenced within your code, ultimately leading to more reliable and maintainable JavaScript applications.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Creating a Custom Hook in React]]></title><description><![CDATA[React.js is a popular JavaScript library for building user interfaces. It's been a while now when react introduced hooks to manage state and lifecycle in functional components. React provide various built-in hooks for different purposes. But we can also create our own custom hooks to encapsulate and reuse complex logic between components.]]></description><link>https://codeentity.tech/react-custom-hook/</link><guid isPermaLink="false">https://codeentity.tech/react-custom-hook/</guid><category><![CDATA[React]]></category><category><![CDATA[JS Frameworks]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Tue, 28 Mar 2023 12:11:44 GMT</pubDate><content:encoded>&lt;h4&gt;What are Hooks?&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Hooks&lt;/strong&gt; are a feature introduced in React version 16.8 that allow developers to use state and other React features in functional components without the need for class components. Hooks are functions that allow you to use state, lifecycle methods, and other React features inside functional components.&lt;/p&gt;
&lt;p&gt;There are several built-in hooks in React, including:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useState&lt;/strong&gt;: allows you to add state to a component.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useEffect&lt;/strong&gt;: allows you to perform side effects in a component (such as fetching data from an API and only run when value in dependency array change).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useLayoutEffect&lt;/strong&gt;: similar to useEffect but runs synchronously after all DOM mutations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useContext&lt;/strong&gt;: allows you to access context values in a component.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useReducer&lt;/strong&gt;: an alternative to useState that allows for more complex state management.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useRef&lt;/strong&gt;: allows you to reference DOM elements or values that persist between renders.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useMemo&lt;/strong&gt;: allows you to memoize a value (i.e. only recalculate when value in dependency array change).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;useCallback&lt;/strong&gt;: allows you to memoize a function (i.e. only recreate when value in dependency array change).&lt;/p&gt;
&lt;h4&gt;What is a custom hook?&lt;/h4&gt;
&lt;p&gt;React custom hooks are reusable functions that encapsulate and share logic between components. They allow developers to abstract away complex logic and create more modular, composable code. Custom hooks are created using the &lt;code&gt;use&lt;/code&gt; prefix and follow the rules of hooks in React, meaning they can only be called at the top level of a component or other hook.&lt;/p&gt;
&lt;p&gt;As a React developer, it’s important to learn the process of creating custom hooks to solve problems or add missing features within your own React projects. You can create custom hooks for various purposes like fetching, posting data, managing local storage, listening to screen size (breakpoints) change for css in js.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To create a custom hook, it’s important to remember the following two rules:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Custom Hooks should always be named with the prefix &lt;code&gt;use&lt;/code&gt;. For example, a custom hook that manages local storage could be named &lt;code&gt;useLocalStorage&lt;/code&gt;, while a hook that handles authentication could be named &lt;code&gt;useAuthentication&lt;/code&gt;. In our case, we’ll be creating a hook called &lt;code&gt;useFetch&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Custom Hooks should be composed of one or more built-in React Hooks or other custom Hooks. This means that every custom Hook is essentially a new combination of Hooks. If a custom Hook doesn’t use any Hooks internally, it shouldn’t be considered a custom Hook and should not use the &lt;code&gt;use&lt;/code&gt; prefix.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Let’s Start Creating our own custom hook called &lt;code&gt;useFetch&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Before start coding we will do brainstorming about what we need this custom hook to do and how much code abstraction we want.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So generally when we fetch data from api we set that data in a state variable or in store and show that data in UI using JSX.&lt;/li&gt;
&lt;li&gt;We also store error in case if api fail or throw any error we would show proper error message in UI.&lt;/li&gt;
&lt;li&gt;Then we also use a loading state to convey user that there is some processing going on by showing a loader or skeleton screen.&lt;/li&gt;
&lt;li&gt;At last we also want to cancel the previous api call if we make same api call again. This is useful in case where user is searching. We should cancel the previous calls to make sure user see correct data on UI.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Now let’s start the coding 🚀&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useFetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above we have an implementation of the hook which we can use in a component.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;MyComponent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useFetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://jsonplaceholder.typicode.com/todos/1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Loading...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Error: &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this is lacking some features like&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It will only run on component mount. There is no other way to refetch the data.&lt;/li&gt;
&lt;li&gt;This is always run on component mount we can’t skip the call.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Let’s add missing features to this hook&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useCallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useFetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useCallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; refetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now this hook will the the api call&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When we update the url (if this is a state and cause re-render)&lt;/li&gt;
&lt;li&gt;We are now exporting a new function &lt;code&gt;refetch&lt;/code&gt; and we can call this function to fetch data again on let’s say a button click.&lt;/li&gt;
&lt;li&gt;At last we have added a new config property &lt;code&gt;skip&lt;/code&gt;. If we set this to true the API call will be skipped and we can use refetch to fetch the data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Finally we will add the &lt;code&gt;abortController&lt;/code&gt; to cancel the previous api call the we try to make next api call before previous call finish executing.&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useCallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useFetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;abortController&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useCallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;abortController&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;abort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;abortController&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;AbortController&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          signal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;abortController&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;signal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setError&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; refetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetchData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;By creating custom hooks like this, we are encapsulating complex logic and can reuse this across multiple components, making our code more modular and easier to maintain.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now to to make a fetch API call in a component we just need a single expression like this.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;refetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useFetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  url&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://jsonplaceholder.typicode.com/todos/1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  skip&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;https://codesandbox.io/s/blue-snowflake-uc88ej?fontsize=14&amp;#x26;hidenavigation=1&amp;#x26;theme=dark&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;img src=&quot;https://codesandbox.io/static/img/play-codesandbox.svg&quot; alt=&quot;Edit blue-snowflake-uc88ej&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Overall, React custom hooks are a powerful way for creating reusable and modular code in React applications. They can help reduce duplication, improve code organization, and make it easier to maintain and update complex logic over time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Checkout following libraries for more custom ready to use hooks&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://streamich.github.io/react-use/?path=/story/components-usekey--demo&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;react-use&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://beizhedenglong.github.io/react-hooks-lib/?path=/story/async-useasync--demo&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;react-hooks-lib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kitze/react-hanger&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;react-hanger&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-19 { color: #333333FF; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Solid JS vs React JS. What is Better?]]></title><description><![CDATA[SolidJS is a blazing-fast framework that dodges virtual DOM manipulation. Let's see how it stacks up against ReactJS, the industry standard, when it comes to flexibility, performance, community and developer productivity..]]></description><link>https://codeentity.tech/solid-vs-react/</link><guid isPermaLink="false">https://codeentity.tech/solid-vs-react/</guid><category><![CDATA[Solid]]></category><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[This vs That]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sat, 11 Mar 2023 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;Choosing the correct JavaScript framework is crucial for the success of your web development project in today’s fast-paced world. With a lot of options, deciding on the most suitable one for your needs can be confusing.&lt;/p&gt;
&lt;p&gt;With &lt;strong&gt;ReactJS&lt;/strong&gt; being released in &lt;strong&gt;2013&lt;/strong&gt; it should not be much of a surprise that it’s more popular than &lt;strong&gt;SolidJS&lt;/strong&gt; which was first open-sourced in &lt;strong&gt;2018&lt;/strong&gt; and officially had version 1.0 released in &lt;strong&gt;2021&lt;/strong&gt;, making it roughly 5 years younger than ReactJS. But SolidJS is &lt;a href=&quot;https://krausest.github.io/js-framework-benchmark/2022/table_chrome_104_windows.html#eyJmcmFtZXdvcmtzIjpbImtleWVkL3JlYWN0LWhvb2tzIiwia2V5ZWQvc29saWQiXSwiYmVuY2htYXJrcyI6WyIwMV9ydW4xayIsIjAyX3JlcGxhY2UxayIsIjAzX3VwZGF0ZTEwdGgxa194MTYiLCIwNF9zZWxlY3QxayIsIjA1X3N3YXAxayIsIjA2X3JlbW92ZS1vbmUtMWsiLCIwN19jcmVhdGUxMGsiLCIwOF9jcmVhdGUxay1hZnRlcjFrX3gyIiwiMDlfY2xlYXIxa194OCIsIjIxX3JlYWR5LW1lbW9yeSIsIjIyX3J1bi1tZW1vcnkiLCIyM191cGRhdGU1LW1lbW9yeSIsIjI1X3J1bi1jbGVhci1tZW1vcnkiLCIyNl9ydW4tMTBrLW1lbW9yeSIsIjMxX3N0YXJ0dXAtY2kiLCIzNF9zdGFydHVwLXRvdGFsYnl0ZXMiXSwiZGlzcGxheU1vZGUiOjEsImNhdGVnb3JpZXMiOlsxLDIsMyw0XX0=&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;faster and efficient&lt;/a&gt; then ReactJS in almost all the metrics.&lt;/p&gt;
&lt;h4&gt;So what is SolidJS?&lt;/h4&gt;
&lt;p&gt;SolidJS is a modern frontend library that focuses on performance and fine-grained reactivity which means that it will not re-render the components every time a state updates but will track the functions and blocks using a dependency and update or execute that part only. Therefore it doest not use a virtual DOM but instead makes use of a compiler to track and update the reactive parts of your components.&lt;/p&gt;
&lt;p&gt;On the surface, SolidJS and ReactJS appear to be closely related. Both SolidJS and ReactJS use JSX for templating (HTML in JS) and use hooks, functional components. SolidJS follows the same philosophy as ReactJS, with unidirectional data flow, read/write segregation and immutable interfaces.&lt;/p&gt;
&lt;p&gt;But in browser, both manipulate page’s HTML elements (DOM) differently to deliver the desired user experience. ReactJS uses virtual dom and diffing algorithm to update dom on state update and SolidJS use reactive primitives (proxies) to manage state and use its compiler to update dom thus does not require a virtual dom.&lt;/p&gt;
&lt;h4&gt;A Brief Comparison&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;Feature&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;ReactJS&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;SolidJS&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;TypeScript support&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Declarative nature&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Unidirectional data flow&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;JSX first-class support&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Direct manipulation of the DOM&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Avoids component re-rendering&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Highly performant&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Rich community and ecosystem&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Excellent developer documentation&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Scaffolding tools&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Conditional rendering&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Server-side rendering (i.e., hydration)&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;Concurrent rendering (i.e., suspense)&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Now we’ll go into more detail on the similarities and differences between ReactJS and SolidJS.&lt;/p&gt;
&lt;h4&gt;Starting a new project&lt;/h4&gt;
&lt;p&gt;The most critical part of adopting any frontend framework is its ease of use. No matter how performant a framework is, If using it to create a new project is too complex, its adoption in the frontend ecosystem will be slow.&lt;/p&gt;
&lt;h5&gt;Creating a new ReactJS project&lt;/h5&gt;
&lt;p&gt;ReactJS has different options for creating a new project, including &lt;a href=&quot;https://create-react-app.dev/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;create-react-app&lt;/a&gt;, &lt;a href=&quot;https://vitejs.dev/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Vite&lt;/a&gt; and a manual setup using &lt;a href=&quot;https://webpack.js.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Webpack&lt;/a&gt;. The most widely used is &lt;code&gt;create-react-app&lt;/code&gt;. You can read more about this topic &lt;a href=&quot;/7-ways-to-create-react-app/&quot;&gt;here&lt;/a&gt;. With Node.js installed on your computer, you can run this command on your terminal to create a new React project using &lt;code&gt;create-react-app&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;sh&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; npx create-react-app react-app&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will generate a new react application named &lt;strong&gt;react-app&lt;/strong&gt; with webpack as the build tool and npm as the default package manager.&lt;/p&gt;
&lt;h5&gt;Creating a new SolidJS project&lt;/h5&gt;
&lt;p&gt;You can use SolidJS &lt;a href=&quot;https://github.com/solidjs/templates&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Vite Templates&lt;/a&gt; to create a new app. To create your new SolidJS app, run following commands on your terminal:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;sh&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; npx degit solidjs/templates/js my-app&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; my-app&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; npm i &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;# or yarn or pnpm&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will generate a new SolidJS app named &lt;strong&gt;my-app&lt;/strong&gt; with npm as the package manager and Vite as the build tool.
Now you can use &lt;code&gt;npm run dev&lt;/code&gt; to run the local server.&lt;/p&gt;
&lt;h4&gt;Component Structure&lt;/h4&gt;
&lt;p&gt;Components are one of the fundamental building blocks of modern frontend frameworks. React and SolidJS have exactly the same programmatic structures and support for components (individual, reusable pieces of code). SolidJS components look very similar to React functional components, and they both use &lt;strong&gt;JSX&lt;/strong&gt;, the popular HTML-like syntax extension to JavaScript.&lt;/p&gt;
&lt;p&gt;React and SolidJS offer the same components, but each framework has a unique rendering approach. React components render every time (barring memoization use), while SolidJS components only render once.&lt;/p&gt;
&lt;div style=&quot;display:flex; gap:0.5rem; flex-wrap:wrap;&quot;&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//SolidJS component&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./Component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Solid Application&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;App&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//ReactJS component&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./Component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;React Application&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;App&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As you can see basic structure of both components is same. Also both use props the same way. The only difference is Solid does not allow prop destructuring as it loses the reference of the state variable due to this.&lt;/p&gt;
&lt;h4&gt;State Management&lt;/h4&gt;
&lt;p&gt;State refers to the data that frontend app use to either show on UI or do some action on. States are meant to change on user interaction and update the UI accordingly.
State can be both global (available throughout the app) and local(available to a specific component).&lt;/p&gt;
&lt;h5&gt;State Management in ReactJS&lt;/h5&gt;
&lt;p&gt;For local state management in individual components, React use &lt;code&gt;useState&lt;/code&gt; hook. Hooks are basically functions intended to run when triggered by the framework at specific times. For eg. useState function will run whenever component re-render and keeps track of the value you set using setter method. Under the hood &lt;code&gt;useState&lt;/code&gt; hook use &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Closures&lt;/a&gt; to achieve this. Apart form this we can use &lt;code&gt;useRef&lt;/code&gt; hook also to store the data but this is not going to trigger the re-render of the function.&lt;/p&gt;
&lt;h5&gt;State Management in SolidJS&lt;/h5&gt;
&lt;p&gt;SolidJs also use similar approach to manage state called &lt;code&gt;createSignal&lt;/code&gt;. It looks similar to &lt;code&gt;react&lt;/code&gt; but is very different fundamentally. &lt;code&gt;createSignal&lt;/code&gt; method returns an array of two functions &lt;code&gt;[getter,setter] = createSignal()&lt;/code&gt; which we can call to get and set the value. On the other hand, the SolidJS &lt;code&gt;createSignal&lt;/code&gt; method can be used outside a component, so it’s easy to export it like any other variable and import it in any component it’s needed. This makes handling global state straightforward in SolidJS.
Apart from this SolidJs also have a concept of derived Signal where you can do the operations on the the existing state to return a new value which will change every time state updates.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A function that accesses a signal is effectively also a signal: when its wrapped signal changes it will in turn update its readers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setCount&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createSignal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Signal&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;doubleCount&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Derived Signal&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Side Effects&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;React&lt;/strong&gt; use &lt;code&gt;useEffect&lt;/code&gt; hook to trigger side-effects on state change. useEffect hooks accepts a callback function and a dependency array. An empty dependency array means effect callback will run only once on component mount. We can also return a &lt;code&gt;cleanup function&lt;/code&gt; from the callback which react is going to run every-time before re-calling the functions and at last on component unmount.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createConnection&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;serverUrl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;roomId&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;roomId&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above useEffect callback will run on component mount and after that every time roomId change. That’s why it is preferred to pass primitive data types in dependency array as objects, arrays as react uses &lt;a href=&quot;https://dmitripavlutin.com/how-to-compare-objects-in-javascript/?ref=retool-blog&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;referential equality&lt;/a&gt; to check whether these complex values have changed.
To make sure object is created only when required we can use &lt;code&gt;useMemo&lt;/code&gt; hook which returns the same value and reference until a value in dependency array change.
In case of functions we should use &lt;code&gt;useCallback&lt;/code&gt; hook which again is going to return same function reference until a value in dependency array change.&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;SolidJS&lt;/strong&gt; an effect can be created by importing &lt;code&gt;createEffect&lt;/code&gt; from solid-js and providing it a function. The effect automatically subscribes to any signal that is read during the function’s execution and reruns when any of them change. This means that we just need to use the state getter function inside the createEffect and sold will take care of the rest.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setCount&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createSignal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;The count is now&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;())&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above callback function inside create effect will reruns whenever count changes.&lt;/p&gt;
&lt;h4&gt;Memoization&lt;/h4&gt;
&lt;p&gt;React depends on memoization for its applications to render quickly so it provides different memoization techniques from component memoization to functions memoization. Its important in react to use these as react will re-render components on state update and its upto us to figure out if we want to re-render a component, calculate a value or initialize a function on state update or not.&lt;/p&gt;
&lt;h5&gt;memo&lt;/h5&gt;
&lt;p&gt;memo is a higher order function which takes a component as first param and a callback function with boolean return value in second param. If you don’t pass second param react will shallow compare the current and previous props to determine if to render a component or not.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;MyComponent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/* render using props */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;areEqual&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;prevProps&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;nextProps&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  return true if passing nextProps to render would return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  the same result as passing prevProps to render,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  otherwise return false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//true means component will not  re-render&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//false means component  re-render.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//This is the inverse from shouldComponentUpdate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;memo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;MyComponent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;areEqual&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;Unlike the &lt;code&gt;shouldComponentUpdate()&lt;/code&gt; method on class components, the &lt;code&gt;areEqual&lt;/code&gt; function returns &lt;code&gt;true&lt;/code&gt; if the props are equal and &lt;code&gt;false&lt;/code&gt; if the props are not equal. This is the inverse from &lt;code&gt;shouldComponentUpdate&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;useCallback&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;useCallback&lt;/code&gt; hook lets you cache a function definition between re-renders. Means if you are passing a function down to a component which is using memo the component will still re-render on parent re-render as you are creating new definition of the passed function. In that case you can you &lt;code&gt;useCallback&lt;/code&gt; hook that let’s you cache the function reference between re-renders.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;8&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cachedFn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useCallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;useMemo&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;useMemo&lt;/code&gt; lets you cache the result of a calculation between re-renders. So if you are doing some very expensive operation to get a value on component render you can use this hook to cache the value so that if any dependency updates that only function will run to calculate the value.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;9&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cachedValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useMemo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;calculateValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;SolidJS createMemo&lt;/h5&gt;
&lt;p&gt;SolidJS manages memoization through a single method called &lt;code&gt;createMemo&lt;/code&gt;. This method keeps track on any signal or derived state used and run only when any value updates.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;10&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setCount&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createSignal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cachedData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createMemo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//some expensive operations using count()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;())&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Is SolidJS Better Than ReactJS?&lt;/h4&gt;
&lt;p&gt;Deciding whether to learn SolidJS or ReactJS depends on several factors you want to prioritize in your web app or web development journey.&lt;/p&gt;
&lt;p&gt;SolidJS outperforms ReactJS in terms of performance and user-friendliness. Although it shares similarities with React, SolidJS has distinct implementation differences. For instance, state management in SolidJS is more straightforward, and its rendering and DOM update mechanisms are faster than those of ReactJS. Additionally, SolidJS offers a wide range of built-in functionalities that would require external libraries in ReactJS.&lt;/p&gt;
&lt;p&gt;However, SolidJS being a relatively new framework, hasn’t gained the same level of adoption and ecosystem size as ReactJS. Therefore, it may be easier to find third-party packages and integrations that are compatible with ReactJS rather than SolidJS.&lt;/p&gt;
&lt;p&gt;Furthermore, resources for learning and problem-solving are more readily available for ReactJS on websites like Stack Overflow and programming blogs. Additionally, if you’re looking for job opportunities in web development, ReactJS currently has a larger job market than SolidJS.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ultimately&lt;/strong&gt;, learning SolidJS should not pose a challenge for those who have already learned React because SolidJS offers a simpler syntax compared to React and use things similar to react like &lt;code&gt;JSX&lt;/code&gt;, &lt;code&gt;States&lt;/code&gt;, &lt;code&gt;Effects&lt;/code&gt;, &lt;code&gt;Memos&lt;/code&gt;.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-19 { color: #333333FF; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Infinite scrolling in React]]></title><description><![CDATA[Infinite scrolling is a popular technique used in web development to provide a seamless user experience by loading content dynamically as the user scrolls down the page. One way to implement infinite scrolling in a React application is by using the IntersectionObserver API, which allows you to detect when an element enters or exits the viewport.]]></description><link>https://codeentity.tech/react-infinite-scrolling/</link><guid isPermaLink="false">https://codeentity.tech/react-infinite-scrolling/</guid><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 19 Feb 2023 12:11:44 GMT</pubDate><content:encoded>&lt;h4&gt;So What is infinite scrolling?&lt;/h4&gt;
&lt;p&gt;Infinite scrolling is a technique used in web design to allow users to scroll through a large amount of content without having to navigate through multiple pages. It works by loading new content as the user scrolls down the page, dynamically updating the content as the user reaches the end of the current page.&lt;/p&gt;
&lt;h4&gt;How can we Implement this technique?&lt;/h4&gt;
&lt;p&gt;Infinite scrolling is often implemented using JavaScript, either by listening to &lt;code&gt;scroll&lt;/code&gt; events or by using the &lt;code&gt;IntersectionObserver&lt;/code&gt; API, which allows you to detect when an element enters or exits the &lt;code&gt;viewport&lt;/code&gt;. When the user reaches the end of the current page, a new request is made to the server to load additional content, which is then appended to the existing content on the page.&lt;/p&gt;
&lt;h4&gt;Why do we need Infinite Scrolling?&lt;/h4&gt;
&lt;p&gt;Infinite scrolling is often used in social media platforms, such as Facebook, Twitter, and Instagram, as well as in e-commerce sites, blogs, and news sites. The goal is to provide a seamless user experience by eliminating the need to click through multiple pages to view more content.&lt;/p&gt;
&lt;h4&gt;Drawbacks of this technique.&lt;/h4&gt;
&lt;p&gt;Infinite scrolling has become a popular design trend, but it also has some drawbacks. One potential issue is that it can make it difficult for users to find specific content, as there is no clear navigation system to access different parts of the content. Additionally, infinite scrolling can cause performance issues if large amounts of content are loaded at once, which can slow down the user’s device or network or if the list become too large and user starts experiencing leg while scrolling.&lt;/p&gt;
&lt;h3&gt;Let’s Start.&lt;/h3&gt;
&lt;p&gt;Here’s an example of how to implement infinite scrolling using the IntersectionObserver API in a React:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;jsx&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;useRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./App.scss&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;CollegeCard&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./components/college-card/college-card&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./components/presentational/loader/loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;getCollegeList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./services/get-college-list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loadingRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setIsLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setPage&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;colleges&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setColleges&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;([])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      rootMargin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      threshold&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;observer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;IntersectionObserver&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;handleObserver&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loadingRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;observer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;observe&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loadingRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;handleObserver&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;entities&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;entities&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isIntersecting&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setPage&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setIsLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;collegeList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getCollegeList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;collegeList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setIsLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setColleges&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;collegeList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;container&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Colleges in North India&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;cards&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;colleges&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;colleges&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;college&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;CollegeCard&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;college&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;college&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          ))&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;loadingRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isLoading&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;App&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Take a look at this &lt;a href=&quot;https://iamvishal345.github.io/frontend-task-college/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Demo&lt;/a&gt; which is using this code written above.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-11 { color: #8190A0; }
  .quiet-light .grvsc-tZ0ymb-19 { color: #333333FF; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Front End interview archive]]></title><description><![CDATA[This article is a compilation of all the interviews I went through.]]></description><link>https://codeentity.tech/interview-archive/</link><guid isPermaLink="false">https://codeentity.tech/interview-archive/</guid><category><![CDATA[Javascript]]></category><category><![CDATA[React]]></category><category><![CDATA[Webdev]]></category><category><![CDATA[Career]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Mon, 02 Jan 2023 12:11:44 GMT</pubDate><content:encoded>&lt;h4&gt;Archive&lt;/h4&gt;
&lt;h5&gt;Company 1&lt;/h5&gt;
&lt;h6&gt;Round One&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Flatten the object
Object property can have a string, number, array(nested),boolean, object.&lt;/li&gt;
&lt;li&gt;How async tasks work in js.&lt;/li&gt;
&lt;li&gt;Callback Queue and Microtask queue.&lt;/li&gt;
&lt;li&gt;Code output&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;&amp;lt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;++){&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;		&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;	}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;5&quot;&gt;
&lt;li&gt;Change above snippet to console 1,2,3,4.&lt;/li&gt;
&lt;li&gt;What is IIFE (Based on previous question’s answer).&lt;/li&gt;
&lt;li&gt;Difference between callback flow and promise flow.&lt;/li&gt;
&lt;li&gt;Implement Inheritance using classes.&lt;/li&gt;
&lt;li&gt;Convert it into functional (Prototypal) inheritance.&lt;/li&gt;
&lt;li&gt;How cache validation work.&lt;/li&gt;
&lt;li&gt;Updating cache in browser using webpack(versioning).&lt;/li&gt;
&lt;li&gt;Micro frontend framework.&lt;/li&gt;
&lt;li&gt;Create a static function LastFulfilled() to Promise object.
It will take an array of promises and will resolve or reject only when last promise(Takes most time) will resolve or reject.(Return only last response).&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Around 20 minutes of discussion on how I implemented custom grid in my current project. How fixed and scrollable columns work. What approach I took and why.&lt;/li&gt;
&lt;li&gt;Some questions around JS architecture. Call stack, CB queue, Priority Queue.&lt;/li&gt;
&lt;li&gt;Service workers, web workers&lt;/li&gt;
&lt;li&gt;Cache strategies in workbox. Route registering&lt;/li&gt;
&lt;li&gt;Polyfill for Reduce, Bind&lt;/li&gt;
&lt;li&gt;Closure (Basic problem)
Create a function which returns an objet with next() as property.
Calling next should return +1 value every time it is called. Like 1,2,3,4…&lt;/li&gt;
&lt;li&gt;Convert class based inheritance to prototypal.&lt;/li&gt;
&lt;li&gt;How to optimize slow page in react.&lt;/li&gt;
&lt;li&gt;Profiling, SSR, Lazy Loading.&lt;/li&gt;
&lt;li&gt;Pure components.&lt;/li&gt;
&lt;li&gt;useCallback and useMemo.&lt;/li&gt;
&lt;li&gt;Some questions on React 18.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Three&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;How will you decide if we should use SSR or CSR.&lt;/li&gt;
&lt;li&gt;SSR using ReactDOMServer.&lt;/li&gt;
&lt;li&gt;React Handson
Create a commentBox and show the comment
list.
In Comment list user can reply to a comment till nth level.
User can Edit any comment.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Four (Managerial)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Intro&lt;/li&gt;
&lt;li&gt;Why you chose FE Domain.&lt;/li&gt;
&lt;li&gt;From my POV what is good work env.&lt;/li&gt;
&lt;li&gt;What are your expectations from company regarding your personal growth.&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;Company 2&lt;/h5&gt;
&lt;h6&gt;Round One&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;What is React.&lt;/li&gt;
&lt;li&gt;How React is different from Angular.&lt;/li&gt;
&lt;li&gt;Can we force rerender without updating state.&lt;/li&gt;
&lt;li&gt;Can we stop rerender after updating state.&lt;/li&gt;
&lt;li&gt;What are closure in JS and how React hook use this concept.&lt;/li&gt;
&lt;li&gt;Explain useCallback and useMemo Hook.&lt;/li&gt;
&lt;li&gt;React handson:
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Live&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;an&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;API&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;regular&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;intervals&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;What is cors.&lt;/li&gt;
&lt;li&gt;What is a preflight network call.&lt;/li&gt;
&lt;li&gt;Problem Solving
Given an unsorted array with values -1000&amp;#x3C;n&amp;#x3C;1000 find largest product of any 3 values&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;What is React.&lt;/li&gt;
&lt;li&gt;How diffing algorithm work.&lt;/li&gt;
&lt;li&gt;How react handle dom mutations.&lt;/li&gt;
&lt;li&gt;Create a function to compare two values.
Values can be string, numbers , array (nested to nth level) , object(nested)&lt;/li&gt;
&lt;li&gt;What is Redux.&lt;/li&gt;
&lt;li&gt;Principles of Redux.&lt;/li&gt;
&lt;li&gt;Create a basic redux architecture.
Create createStore, subscribe methods.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Three&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;Promise.all()&lt;/code&gt; custom implementation where if all promises fail then it should throw error and if any promise pass it should resolve but only after all promises either resolve or reject&lt;/li&gt;
&lt;li&gt;Randomize a given array&lt;/li&gt;
&lt;li&gt;What are browser caching techniques.&lt;/li&gt;
&lt;li&gt;Write a function which takes a string class name and return an array of all the elements that contain the class. i.e. Basic implementation of querySelectorAll() with class.&lt;/li&gt;
&lt;li&gt;Some techniques to optimize website load time&lt;/li&gt;
&lt;li&gt;What are various web page performance metrics&lt;/li&gt;
&lt;li&gt;What is debouncing and throttling.&lt;/li&gt;
&lt;li&gt;Explain server side rendering.&lt;/li&gt;
&lt;li&gt;Write a JSON structure of a directory like which contain files, folders with nested files folders&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;json&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now write a function to traverse this object and print output on console with proper indentation on console.
Now remove console from the function and return a string with indentation and new line 10. Call by value and call by reference in javascript&lt;/p&gt;
&lt;h6&gt;Round Four (Managerial)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;What are programming paradigms.&lt;/li&gt;
&lt;li&gt;Difference between OOPs and Functional (Prototypal) programming.&lt;/li&gt;
&lt;li&gt;Why we should or shouldn’t use typescript.&lt;/li&gt;
&lt;li&gt;Tell me about your role and responsibilities in your current project.&lt;/li&gt;
&lt;li&gt;How are you contributing in your project.&lt;/li&gt;
&lt;li&gt;What is SSR.&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;System design&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Design a workflow for SSO website.
Let’s say I have three websites a.com, b.com, c.com
How SSO will be implemented like logging in request to SSO website and logout from all if logout from SSO.
What will you store in Client side and why.
What will happen on first visit and subsequent visits.
What will happen on refreshing.
Possible end points, query params, request bodies and data you will require.&lt;/li&gt;
&lt;li&gt;Design a notification system. API Poling, web sockets, server sent events.
How will you handle UI, custom popup.
Browser notifications API handling two usecases.
Permission granted.
Permission rejected.
For second usecase how to get user’s attention on notification if tab is not active.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Handson&lt;/h6&gt;
&lt;p&gt;Design a basic html previewer.
I used dangersoulyinjectHTML.
Improve it. Sensitizing user input.
Alternative solutions. Web Components, iFrames.&lt;/p&gt;
&lt;h6&gt;Round Five (Director)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Merge two sorted arrays.&lt;/li&gt;
&lt;li&gt;Do it without using third array.&lt;/li&gt;
&lt;li&gt;Tell me about your project. Roles responsibilities.&lt;/li&gt;
&lt;li&gt;What is VirtualDOM. Why react use virtualDOM.&lt;/li&gt;
&lt;li&gt;Design a accordion&lt;/li&gt;
&lt;li&gt;Animate its open and close actions.&lt;/li&gt;
&lt;li&gt;What is difference between TCP &amp;#x26; UDP.&lt;/li&gt;
&lt;li&gt;What is a DNS.&lt;/li&gt;
&lt;li&gt;How URL to IP mapping is done.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Company 3&lt;/h4&gt;
&lt;h6&gt;Round one&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Difference between let, var, const.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Temporal dead zone.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Type of class&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Closure output code snippet&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;52&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Priority queue and callback queue.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Output&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Vishal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to get vishal in console for previous question.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;this&lt;/code&gt; in arrow function&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Flatten a nested array.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Difference between Debounce and Throttle.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Implement both.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Difference between Context API and Redux.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Which to use in which case.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Memoization of state in Redux&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;useSelector hook&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;useReducer hook (useCase)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Usecases of useCallback and useMemo hook&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Micro FE- React.lazy&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In which case we still need to use class component (Error Boundary)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;React Handson:
Get Data from API- Render it to a table
Add a checkbox
filter data based on a property(true/false) by value of checkbox&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Questions about project.&lt;/li&gt;
&lt;li&gt;Questions about micro FE (as my current project is a micro FE).&lt;/li&gt;
&lt;li&gt;Prototype in JS.&lt;/li&gt;
&lt;li&gt;Implement Class based and prototypal inheritance.&lt;/li&gt;
&lt;li&gt;What is &lt;strong&gt;proto&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;what is &lt;code&gt;hasOwnProperty&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Generator function&lt;/li&gt;
&lt;li&gt;Its use in redux saga.&lt;/li&gt;
&lt;li&gt;How it works&lt;/li&gt;
&lt;li&gt;Some features of es6+&lt;/li&gt;
&lt;li&gt;Arrow functions and normal functions&lt;/li&gt;
&lt;li&gt;Some features of React 18&lt;/li&gt;
&lt;li&gt;Major difference between class based and functional components (From a developer POV.)&lt;/li&gt;
&lt;li&gt;useEffect() vs componentDidUpdate()&lt;/li&gt;
&lt;li&gt;Difference in setState in class and functional component.&lt;/li&gt;
&lt;li&gt;Create any custom hook (Again created useForm)&lt;/li&gt;
&lt;li&gt;Testing React testing library vs Enzyme.&lt;/li&gt;
&lt;li&gt;Enzyme Shallow va mount.&lt;/li&gt;
&lt;li&gt;How you build and deploy the app.&lt;/li&gt;
&lt;li&gt;Github package versioning and publishing (As we were using github to publish packages).&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Three (Managerial)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Explain hooks.&lt;/li&gt;
&lt;li&gt;How hooks work (closures).&lt;/li&gt;
&lt;li&gt;React component lifecycle (Three Phases).&lt;/li&gt;
&lt;li&gt;useEffect() all 3 phases.&lt;/li&gt;
&lt;li&gt;create a custom hook to manage a from (Again created useForm hook).&lt;/li&gt;
&lt;li&gt;How to check if user is offline.&lt;/li&gt;
&lt;li&gt;Intercept API in offline (workbox).&lt;/li&gt;
&lt;li&gt;How remember me works in browser.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Company 4&lt;/h4&gt;
&lt;h6&gt;Round One&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Design a Grid (40 minutes)
&lt;ul&gt;
&lt;li&gt;Make it reusable and configurable.&lt;/li&gt;
&lt;li&gt;Column based Sorting, Filtering.&lt;/li&gt;
&lt;li&gt;Option to render custom cell and column.&lt;/li&gt;
&lt;li&gt;Pagination&lt;/li&gt;
&lt;li&gt;Loader, No data state&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Questions around it.
&lt;ul&gt;
&lt;li&gt;Async data loading&lt;/li&gt;
&lt;li&gt;Infinite scrolling&lt;/li&gt;
&lt;li&gt;Using scroll event or Intersection observer.&lt;/li&gt;
&lt;li&gt;React Virtualization&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;p&gt;&lt;strong&gt;DS&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reverse an array&lt;/li&gt;
&lt;li&gt;Improve solution (do not use new array) (use two pointers).&lt;/li&gt;
&lt;li&gt;2Sum problem ( Given an array and a target number, Return all combinations for target sum and remove duplicated like if returning [1,6] do not return [6,1]).&lt;/li&gt;
&lt;li&gt;3Sum problem. (Update solution to return combination of 3 values)&lt;/li&gt;
&lt;li&gt;Implement Linked List
&lt;ul&gt;
&lt;li&gt;Create Add, Get methods.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reverse the linked list.&lt;/li&gt;
&lt;li&gt;Create a Binary tree in js like create a Tree class and a Node class.&lt;/li&gt;
&lt;li&gt;Add methods like adding value, getting value.&lt;/li&gt;
&lt;li&gt;DFS and BFS traversal.&lt;/li&gt;
&lt;li&gt;Merge two sorted array.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;JS&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hoisting in JS&lt;/li&gt;
&lt;li&gt;Closures.&lt;/li&gt;
&lt;li&gt;Design Patterns in JS.&lt;/li&gt;
&lt;li&gt;Questions around callbacks, promises and async await.&lt;/li&gt;
&lt;li&gt;Top level await in Node.&lt;/li&gt;
&lt;li&gt;SSR vs CSR, ISR(Next.js)&lt;/li&gt;
&lt;li&gt;Prototypal Inheritance (Implement)&lt;/li&gt;
&lt;li&gt;How react use closures.&lt;/li&gt;
&lt;li&gt;create useState hook.&lt;/li&gt;
&lt;li&gt;Why we bundle code.&lt;/li&gt;
&lt;li&gt;Any Idea about vite (How it is fast for development).&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Company 5&lt;/h4&gt;
&lt;h6&gt;Round One (Automated)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;What is React.&lt;/li&gt;
&lt;li&gt;Walkthrough Resume.&lt;/li&gt;
&lt;li&gt;Some React MCQs&lt;/li&gt;
&lt;li&gt;Hands on - Screen Shared (Used VS Code)
Create a quiz application in React. (Wireframes given)
Expected
&lt;ul&gt;
&lt;li&gt;Timer of 30 seconds.&lt;/li&gt;
&lt;li&gt;On click of an option show correct i green and incorrect in red. Wait for 3 seconds before moving to next question.&lt;/li&gt;
&lt;li&gt;At last show total score.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Some input output snippets.&lt;/li&gt;
&lt;li&gt;What is Hoisting.&lt;/li&gt;
&lt;li&gt;Function Expressions.&lt;/li&gt;
&lt;li&gt;Some questions around setTimeout and promise.&lt;/li&gt;
&lt;li&gt;Problem Solving
Given an unsorted array with values -1000&amp;#x3C;n&amp;#x3C;1000 find largest product of any 3 values .&lt;/li&gt;
&lt;li&gt;Event Delegation.&lt;/li&gt;
&lt;li&gt;Event Delegation in React.&lt;/li&gt;
&lt;li&gt;Redux and Context API.&lt;/li&gt;
&lt;li&gt;State memoization.&lt;/li&gt;
&lt;li&gt;React Hands on
Create a chess layout with all the divs clickable and on click show and alert box with x,y coordinates of that div.
Improve it by using event delegation.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Three(Managerial)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Discussion around project.&lt;/li&gt;
&lt;li&gt;Tech stack I use (Prefer).&lt;/li&gt;
&lt;li&gt;Redux (Architecture), React-Redux.&lt;/li&gt;
&lt;li&gt;Jest &amp;#x26; React Testing Library.&lt;/li&gt;
&lt;li&gt;PWA (Offline request handling) workbox.&lt;/li&gt;
&lt;li&gt;Custom Hook (Implement any hook) I implemented useForm from react-hook-forms&lt;/li&gt;
&lt;li&gt;useCallback and useMemo (useCase).&lt;/li&gt;
&lt;li&gt;Optimizing a react component.&lt;/li&gt;
&lt;li&gt;Handson
Create a folder structure where folder should expend and collapse on click and file should not be clickable.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Four (Director)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Intro&lt;/li&gt;
&lt;li&gt;Project discussion.&lt;/li&gt;
&lt;li&gt;React Handson.
Create a custom RadioWrapper where options can be passed as children but manage state in wrapper. Used useContext.
Now Optimize it in such a way that when use click on an option, only options with changing states(prev selected and current selected) should rerender.&lt;/li&gt;
&lt;li&gt;Project discussion&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Company 6&lt;/h4&gt;
&lt;h6&gt;Round One&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;What are closures, give examples.&lt;/li&gt;
&lt;li&gt;What is bind().&lt;/li&gt;
&lt;li&gt;Write polyfill for bind.&lt;/li&gt;
&lt;li&gt;Convert it to call() and apply().&lt;/li&gt;
&lt;li&gt;Pure components in React.&lt;/li&gt;
&lt;li&gt;What is shallow Copy and Deep Copy.&lt;/li&gt;
&lt;li&gt;Write a function to deepcopy an object.&lt;/li&gt;
&lt;li&gt;Modify it so that it can deepcopy nested arrays.&lt;/li&gt;
&lt;li&gt;3Sum problem.&lt;/li&gt;
&lt;li&gt;What is a Binary Tree.&lt;/li&gt;
&lt;li&gt;Write a function for DFS.&lt;/li&gt;
&lt;li&gt;Covert recursion into loop.&lt;/li&gt;
&lt;li&gt;Function to print top view of binary tree (Approach and pseudo code).&lt;/li&gt;
&lt;li&gt;What is curring.&lt;/li&gt;
&lt;li&gt;Write a function for sum of infinite curring &lt;code&gt;sum(1)(2)(3)....(n)()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;What is Critical Render Path.&lt;/li&gt;
&lt;li&gt;Explain all the steps.&lt;/li&gt;
&lt;li&gt;Techniques to optimize page’s performance.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Infinite Curring (Repeated).&lt;/li&gt;
&lt;li&gt;XSS and CSRF attacks.&lt;/li&gt;
&lt;li&gt;Difference between Context API and Redux.&lt;/li&gt;
&lt;li&gt;Binary Tree zig-zag traversal.&lt;/li&gt;
&lt;li&gt;Write a function to return all the nodes from dom which contain given class name string.&lt;/li&gt;
&lt;li&gt;React Hands on
Code a Stopwatch.
Three button—&gt; Start , Pause, Reset.&lt;/li&gt;
&lt;li&gt;React Handson
Create a input field. Make an API call(Dummy) when user type. Debounce this API request.&lt;/li&gt;
&lt;li&gt;Difference between Debounce and Throttle.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Three (Managerial)&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Intro&lt;/li&gt;
&lt;li&gt;Why this Company.&lt;/li&gt;
&lt;li&gt;About current Project.&lt;/li&gt;
&lt;li&gt;Role and Responsibilities&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Company 7&lt;/h4&gt;
&lt;h6&gt;Round One&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;JS code snippets.&lt;/li&gt;
&lt;li&gt;React hooks code. Identify the issue.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;isActive&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;setB&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isActive&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isActive&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;I am active&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There are two issues in this.&lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;What is Redux&lt;/li&gt;
&lt;li&gt;Why we need React redux&lt;/li&gt;
&lt;li&gt;Is it mandatory to use react-redux library.&lt;/li&gt;
&lt;li&gt;I said no, What is another way.&lt;/li&gt;
&lt;li&gt;Can we use redux in vanilla js&lt;/li&gt;
&lt;li&gt;I said yes. How?&lt;/li&gt;
&lt;li&gt;what is connect method&lt;/li&gt;
&lt;li&gt;Can you implement it.&lt;/li&gt;
&lt;li&gt;First with class based component.&lt;/li&gt;
&lt;li&gt;Convert it into functional component.&lt;/li&gt;
&lt;/ol&gt;
&lt;h6&gt;Round Two&lt;/h6&gt;
&lt;ol&gt;
&lt;li&gt;Create a timer in React.&lt;/li&gt;
&lt;li&gt;Increment time by 1 second (faced react 18 double render issue. Fixed it).&lt;/li&gt;
&lt;li&gt;Modify it ti create timer with given time in seconds from input field and keep decreasing unit 0.&lt;/li&gt;
&lt;li&gt;Now change input from seconds to minutes and show two divs like digital clock (minutes:seconds).&lt;/li&gt;
&lt;li&gt;Now add a pause button.&lt;/li&gt;
&lt;li&gt;Add a reset button to reset clock to input field value.&lt;/li&gt;
&lt;li&gt;Virtual DOM.&lt;/li&gt;
&lt;li&gt;How diffing algo work.&lt;/li&gt;
&lt;li&gt;Optimizing rerender in react.&lt;/li&gt;
&lt;li&gt;Problem Solving:
Given an array
[1,0,2,0,1,2,1,0,1,2]
Sort this array in one pass.
First is to create three arrays and concatenate.
Improve to inplace sorting.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Company 8&lt;/h4&gt;
&lt;h1&gt;Round One&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;Hoisting.&lt;/li&gt;
&lt;li&gt;Difference between let, const, var.&lt;/li&gt;
&lt;li&gt;callback queue and priority queue.&lt;/li&gt;
&lt;li&gt;Implement debounce.&lt;/li&gt;
&lt;li&gt;What is a prototype&lt;/li&gt;
&lt;li&gt;what is &lt;strong&gt;proto&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Implement promise.all&lt;/li&gt;
&lt;li&gt;Promise array can have string, number, object.&lt;/li&gt;
&lt;li&gt;Merge 2 sorted arrays.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;Round Two&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;Lift coconut puzzle.&lt;/li&gt;
&lt;li&gt;Divide a cake into 8 pieces using 3 cuts.&lt;/li&gt;
&lt;li&gt;zig zag tree traversal.&lt;/li&gt;
&lt;li&gt;Move zeros to last in one pass
[0,1,2,5,0,7,9]—&gt;[1,2,5,7,9,0,0]&lt;/li&gt;
&lt;li&gt;Suppose we have an image of Map of India where user can click on a state.
Write an algorithm to find which state is clicked&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Other&lt;/h4&gt;
&lt;h5&gt;Round 1&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Create a tic tac toe game.&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;Round 1&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;JS output Code snippets.&lt;/li&gt;
&lt;li&gt;Write debounce in JS&lt;/li&gt;
&lt;li&gt;Call Stack, Event Queue&lt;/li&gt;
&lt;li&gt;CSS- centering a DIV&lt;/li&gt;
&lt;li&gt;Adding gap in flex.&lt;/li&gt;
&lt;li&gt;Grid basics&lt;/li&gt;
&lt;li&gt;Symantec tags.&lt;/li&gt;
&lt;li&gt;Block, inline, inline-block&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;Round One&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;JS output code snippets&lt;/li&gt;
&lt;li&gt;What is a polyfill.&lt;/li&gt;
&lt;li&gt;Write polyfill for bind()&lt;/li&gt;
&lt;li&gt;Write a function to flatten a nested object&lt;/li&gt;
&lt;li&gt;Object can have array as property&lt;/li&gt;
&lt;li&gt;Write a function to return all pythagorean triplets from an array.&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;Round One&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Why react.&lt;/li&gt;
&lt;li&gt;React vs vanilla js&lt;/li&gt;
&lt;li&gt;Component lifecycle.&lt;/li&gt;
&lt;li&gt;Hands on:
Create star rating component
We can pass rating in props.
Rating can have decimal value to .5
like 1.5, 2.5
Print half star in that case.
If I hover on any star, all previous stars should fill and on click persist rating and onblur go to prev rating.&lt;/li&gt;
&lt;/ol&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Front End interview questions compilation]]></title><description><![CDATA[This article is a compilation of all the questions asked during my job hunt in product-based companies.]]></description><link>https://codeentity.tech/fe-interview-questions-compilation/</link><guid isPermaLink="false">https://codeentity.tech/fe-interview-questions-compilation/</guid><category><![CDATA[Javascript]]></category><category><![CDATA[React]]></category><category><![CDATA[Webdev]]></category><category><![CDATA[Career]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 25 Dec 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;This article is a compilation of all the questions asked during my job hunt in product-based companies.&lt;/p&gt;
&lt;p&gt;I followed this blog during my Interview preparation. Do check this out. &lt;a href=&quot;https://dev.to/devabhijeet/all-front-end-interview-questions-asked-during-my-recent-job-hunt-1kge&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;All front end Interview questions asked during my recent job hunt.&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Interview Process&lt;/h4&gt;
&lt;p&gt;In most of the companies I went through either 4 or 5 rounds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First Round&lt;/strong&gt; JavaScript,CSS advance concepts with 1 or 2 competitive problems(Leetcode easy or medium).
&lt;strong&gt;Second Round&lt;/strong&gt; Advance Javascript and React concepts with 1 UI assignment in React.
&lt;strong&gt;Third Round&lt;/strong&gt; Same as previous Round but more focused on React with a Senior Dev.
&lt;strong&gt;Fourth Round&lt;/strong&gt;(Only in few companies) Design Patterns in JS and React. Questions about application architecture (From Previous projects) and 1 or 2 FE application architecture design problems.
&lt;strong&gt;Fifth Round&lt;/strong&gt; Managerial Round with some technical questions. Mostly about previous projects.&lt;/p&gt;
&lt;h5&gt;Javascript&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;Promise.allSettled()&lt;/code&gt; custom implementation where if all promises fail then it should reject and if any promise pass it should resolve.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customPromiseAll&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rejected&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;err&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rejected&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rejected&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customPromiseAll&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;p4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Randomize a given array.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;randomize&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;randomIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;randomIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;randomIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;randomIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;randomize&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Write a function which takes a string class name and return an array of all the elements that contain the class in document. i.e. Basic implementation of querySelectorAll() with class.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getAllClasses&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;nodes&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;children&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;nodes&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;el&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getAllClasses&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;abc&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Write a JSON structure of a directory like which contain files, folders with nested files folders.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;json&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now write a function to traverse this object and print output on console with proper indentation on console.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;indent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;indent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;indent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;str&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;directoryRoot&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; str&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;5&quot;&gt;
&lt;li&gt;Flatten a nested object. Object property can have a string, number, array(nested),boolean, object.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;vishal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  telephone&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9816120038&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  skills&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Javascript&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  address&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    city&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Bilaspur&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Himachal Pradesh&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    pin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;174021&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  experience&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      company&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;PS&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      time&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        joining&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;30th May 2021&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    previous&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      company&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Infosys&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      time&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        joining&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;3rd December 2018&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        leaving&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;24th May 2021&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;flattenObjFun&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;flattenObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;keys&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    ) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;flattenObjFun&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;flattenObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;flattenObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;flattenObj&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;flatObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;flattenObjFun&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;flatObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;vishal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_telephone&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9816120038&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_skills&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [ &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Javascript&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_address_city&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Bilaspur&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_address_state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Himachal Pradesh&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_address_pin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;174021&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_experience_current_company&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;PS&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_experience_current_time_joining&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;30th May 2021&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_experience_previous_company&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Infosys&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_experience_previous_time_joining&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;3rd December 2018&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  details_experience_previous_time_leaving&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;24th May 2021&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;6&quot;&gt;
&lt;li&gt;Create a static funtion LastFullfilled() to Promise object. It will take an array of promises and will resolve or reject only when last promise(Takes most time) will resolve or reject.(Return only last response).&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;task&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tasksList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;task&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;task&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;task&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lastFullfilled&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;failed&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promise&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;failed&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;failed&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;promises&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reject&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Promise&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lastFullfilled&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tasksList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;7&quot;&gt;
&lt;li&gt;Polyfill for &lt;code&gt;call()&lt;/code&gt;, &lt;code&gt;apply()&lt;/code&gt;, &lt;code&gt;bind()&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printA&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;a1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;a2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customCall&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fun&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fnRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fun&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fnRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customCall&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customCall&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;printA&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customCall&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//1 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customApply&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fun&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fnRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fun&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fnRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customApply&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customApply&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;printA&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customApply&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//3 4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customBind&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fun&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fnRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fun&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fnRef&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customBind&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customBind&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;bindFn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;printA&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customBind&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;obj2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;bindFn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//7 8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;8&quot;&gt;
&lt;li&gt;Polyfill of array &lt;code&gt;reduce&lt;/code&gt;, &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;flat&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;8&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customReduce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;callback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;initialVal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prevValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;initialVal&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prevValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;callback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prevValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prevValue&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customReduce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customReduce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customReduce&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customReduce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;acc&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;acc&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// { value: 10 }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customMap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;callback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;callback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customMap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customMap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customMap&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customMap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//[ 0, 2, 6, 12, 20 ]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customFlat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reduce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;acc&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;acc&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;concat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;isArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customFlat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customFlat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customFlat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customFlat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]]]]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;customFlat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;())&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//[1, 2, 3, 4,  5,6, 7, 8, 9, 10]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;9&quot;&gt;
&lt;li&gt;Closure (Basic problem)
Create a function which returns an objet with next() as property.
Calling next should return +1 value every time it is called. Like 1,2,3,4…&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;9&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;closure&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;closure&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;10&quot;&gt;
&lt;li&gt;Implement &lt;code&gt;debounce&lt;/code&gt; and &lt;code&gt;throttle&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;10&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Debounce&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;debounce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;timer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;timer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;clearTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;timer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;timer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;debounce&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Only in one second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Throttle&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;throttle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;allow&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;allow&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;allow&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;allow&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fn1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;throttle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Only after one second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fn1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Only after one second&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Only in one second&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;React.js Handson&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Create a commentBox and show the comments list.
In Comments list user can reply to a comment till nth level.
User can Edit any comment.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href=&quot;https://codesandbox.io/s/infinite-comments-p2xqdt&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Solution&lt;/a&gt;&lt;/p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;
&lt;p&gt;Fetch live data from a cricket score API.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create 3 buttons &lt;code&gt;Start&lt;/code&gt;, &lt;code&gt;Pause&lt;/code&gt;, &lt;code&gt;Reset&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Clicking on start should fetch data from API after every 10 seconds and show in browser.&lt;/li&gt;
&lt;li&gt;Clicking on pause should pause timer.&lt;/li&gt;
&lt;li&gt;Clicking on reset should reset timer&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Design a basic HTML previewer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Design an accordion with open and close animation. Add props &lt;code&gt;openOne&lt;/code&gt;. If it is true then only one accordion should be opened at a time in Accordion Group. If false all can be opened.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Fetch Data from an API and render to a table. Add a checkbox filter. On checking only the records with a field(status) true should come in table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Design a grid component. It should be reusable and configurable. Add column level sorting and filtering. Add pagination, async data loading and infinite scrolling.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;2 hours assignment:
Create a quiz application in React. (Wireframes given)
Expected&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Timer of 30 seconds.&lt;/li&gt;
&lt;li&gt;On click of an option show correct in green and incorrect in red. Wait for 3 seconds before moving to next question.&lt;/li&gt;
&lt;li&gt;At last show total score.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a 4X4 layout with all the divs clickable and on click show and alert box with x,y coordinates of that div.
Improve it by using event delegation. (This was in Vanilla.js)
&lt;a href=&quot;https://codesandbox.io/s/div-coordinates-9jukr3&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a folder structure where folder should expend and collapse on click and file should not be clickable.
&lt;a href=&quot;https://codesandbox.io/s/folder-structure-l6rv4d?file=/src/Folder.js&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a custom RadioWrapper where options can be passed as children but manage state in wrapper. Used useContext.
Now Optimize it in such a way that when use click on an option, only options with changing states(prev selected and current selected) should rerender.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a tic tac toe game.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create star rating component
We can pass rating in props.
Rating can have decimal value to .5
like 1.5, 2.5
Print half star in that case.
If I hover on any star, all previous stars should fill and on click persist rating and onblur go to prev rating.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Code a Stopwatch. Three button—&gt; Start , Pause, Reset.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a input field. Make an API call(Dummy) when user type. Debounce this API request.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[7 ways to generate a react project]]></title><description><![CDATA[Creating a new React application requires careful consideration of various factors that will impact its scalability, collaboration and compatibility with your current and future tools and needs. These decisions include the type of app you are building (e.g. Complex web app, static landing site , content heavy blog site or an seo targeted e-commerce app), the level of server engagement, the number of developers working on the app, the reuse of components from other applications, and the build and deployment process. These decisions should be made with your end goal in mind and will require a significant amount of effort to ensure the success of the app.]]></description><link>https://codeentity.tech/7-ways-to-create-react-app/</link><guid isPermaLink="false">https://codeentity.tech/7-ways-to-create-react-app/</guid><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Wed, 25 May 2022 12:11:44 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Creating a new React application is not a simple task.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Creating a new React application requires careful consideration of various factors that will impact its scalability, collaboration and compatibility with your current and future tools and needs. These decisions include the type of app you are building (e.g. Complex web app, static landing site , content heavy blog site or an seo targeted e-commerce app), the level of server engagement, the number of developers working on the app, the reuse of components from other applications, and the build and deployment process. These decisions should be made with your end goal in mind and will require a significant amount of effort to ensure the success of the app.&lt;/p&gt;
&lt;h4&gt;So let’s start with what’s React?&lt;/h4&gt;
&lt;p&gt;React is a &lt;strong&gt;JavaScript library&lt;/strong&gt; for building user interfaces. It was developed by Facebook and is widely used for building web and mobile applications. React allows developers to create &lt;strong&gt;reusable components&lt;/strong&gt; that can be easily managed and composed to build complex user interfaces. React uses a &lt;strong&gt;virtual DOM&lt;/strong&gt; (Document Object Model) to optimize the rendering of components and improve the performance of the application.&lt;/p&gt;
&lt;h4&gt;In this article&lt;/h4&gt;
&lt;p&gt;This article presents a collection of the methods, frameworks and tools for creating React applications. These options range from optimizing for quick setup for small websites (or just to test react) to catering to global scale, and some even do both. I hope that this article will assist you in constructing a React application that satisfies your needs, reduces errors and time wasted in the process.&lt;/p&gt;
&lt;h5&gt;1. Nothing but React&lt;/h5&gt;
&lt;p&gt;You can include the React bundle from a CDN directly in your HTML file to quickly get a taste of how React works and what it can do. However, this method is not recommended for creating production applications.&lt;/p&gt;
&lt;p&gt;To use React from a CDN (Content Delivery Network) in an HTML file, you can include the React and ReactDOM libraries by adding script tags to the head of your HTML file.&lt;/p&gt;
&lt;p&gt;Here is an example of how to include React and ReactDOM from a CDN in an HTML file:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;html&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://unpkg.com/react@18.2.0/umd/react.development.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;&amp;lt;!-- your HTML content goes here --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the exact URL of the React library may vary depending on the version of React that you want to use. You can find the latest version of React and ReactDOM at the following URLs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;React: &lt;a href=&quot;https://unpkg.com/react@latest/umd/react.development.js&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://unpkg.com/react@latest/umd/react.development.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;ReactDOM: &lt;a href=&quot;https://unpkg.com/react-dom@latest/umd/react-dom.development.js&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://unpkg.com/react-dom@latest/umd/react-dom.development.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you have included the React and ReactDOM libraries in your HTML file, you can use React to create and render components in your application.&lt;/p&gt;
&lt;p&gt;For example, you can create a simple React component using the &lt;code&gt;React.createElement&lt;/code&gt; function and render it to the page using the&lt;code&gt; ReactDOM.render&lt;/code&gt; function:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;html&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;en&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;UTF-8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;X-UA-Compatible&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;IE=edge&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;viewport&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;width=device-width, initial-scale=1.0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;React CDN&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://unpkg.com/react@18.2.0/umd/react.development.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;ReactDOM&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createRoot&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hello world!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will render an &lt;code&gt;h1&lt;/code&gt; element with the text &lt;code&gt;Hello world!&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Using this way use can not use &lt;code&gt;.jsx&lt;/code&gt; syntax because we don’t have babel parser in place to parse and covert the syntax to plain JS.&lt;/p&gt;
&lt;h4&gt;2. From Scratch (Without any tooling)&lt;/h4&gt;
&lt;p&gt;React and React DOM are JavaScript libraries that are typically installed via the npm package manager. These libraries provide the building blocks for creating web applications using the React framework.&lt;/p&gt;
&lt;p&gt;Once React and React DOM are installed, it is common to also set up a build tool such as webpack and a transpiler such as Babel in order to bundle and transpile the code for the application. This process involves creating configuration files that specify how webpack and Babel should be used to build the application.&lt;/p&gt;
&lt;p&gt;Overall, the process of setting up a React application involves installing the necessary npm packages and configuring webpack and Babel to properly build and transpile the code. This allows developers to manage all of the build-related configuration in a centralized location, making it easier to maintain and update the application as it grows.&lt;/p&gt;
&lt;p&gt;I have written a detailed blog explaining this method. Read it &lt;a href=&quot;/create-react-project-without-cra&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;3. Next.js&lt;/h4&gt;
&lt;p&gt;Next.js is a popular framework for building server-rendered React applications. It provides a simple and efficient way to create React projects with automatic code splitting, server-side rendering, and optimized performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To generate a new React project using Next.js, you can follow these steps:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the create-next-app command-line tool by running &lt;code&gt;npm install -g create-next-app&lt;/code&gt;. This will allow you to easily create a new &lt;code&gt;Next.js&lt;/code&gt; project.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new Next.js project by running the create-next-app command and specifying a name for your project:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;create-next-app my-project&lt;/code&gt; or use &lt;code&gt;npx create-next-app my-project&lt;/code&gt; which don’t require you to install &lt;code&gt;create-next-app&lt;/code&gt; package locally.&lt;/p&gt;
&lt;p&gt;This will create a new directory with the specified name and generate the basic file structure and configuration for a Next.js project.&lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the new project directory and install the dependencies by running npm install.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the development server by running npm run dev. This will start the development server and open a new browser window with your Next.js app.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modify the &lt;code&gt;pages/index.js&lt;/code&gt; file to modify the homepage and add content to your app.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next.js uses the pages directory to define the routes of your app. Each JavaScript file in the pages directory corresponds to a route, and the components exported from those files are rendered when the corresponding route is accessed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, the &lt;code&gt;pages/index.js&lt;/code&gt; file defines the root route of the app, and the components exported from this file are rendered when the root route is accessed.&lt;/p&gt;
&lt;ol start=&quot;8&quot;&gt;
&lt;li&gt;To create a new route create a new js file in pages directory and default export the react component. Next will create a route for you with name of the js file.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, create &lt;code&gt;pages/newPage.js&lt;/code&gt; file and next will create &lt;code&gt;/newPage&lt;/code&gt; route.&lt;/p&gt;
&lt;ol start=&quot;9&quot;&gt;
&lt;li&gt;Next by default will server side render each page and will return static html along will react bundle to browser.&lt;/li&gt;
&lt;li&gt;You can also create dynamic routes in pages directory. Dynamic routes are routes that have a variable component, such as &lt;code&gt;/posts/:id&lt;/code&gt; or &lt;code&gt;/users/:username&lt;/code&gt;. These routes allow you to render different content for each value of the variable component. For example To create a dynamic route for &lt;code&gt;/posts/:id&lt;/code&gt; create a folder with name &lt;code&gt;posts&lt;/code&gt; in pages directory and inside this folder create file &lt;code&gt;[id].js&lt;/code&gt;. Along with this you can create an &lt;code&gt;index.js&lt;/code&gt; which will render on &lt;code&gt;/posts&lt;/code&gt; route.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Along with a react component you can also use lifecycle methods of next.js.&lt;/p&gt;
&lt;p&gt;In a Next.js page &lt;code&gt;getServerSideProps, getInitialProps, getStaticPaths, and getStaticProps&lt;/code&gt; are functions that can be used to fetch data or perform other tasks before a page is rendered. These functions are called “lifecycle methods” because they are executed at different stages of the page rendering process.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is a brief overview of these lifecycle methods:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;getServerSideProps&lt;/code&gt; is a function that is executed on the server side before the page is rendered. It allows you to fetch data or perform other tasks that require server-side rendering, such as server-side rendering with authenticated content or server-side rendering with a database. The results of getServerSideProps are passed to the page as props.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getInitialProps&lt;/code&gt; is a legacy function that was used in Next.js versions prior to 9.3. It is similar to getServerSideProps but is executed on the server side as well as the client side. If you are using a version of Next.js prior to 9.3, you can use getInitialProps to fetch data or perform other tasks before the page is rendered.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getStaticProps&lt;/code&gt; is a function that is executed at build time to generate static pages. It allows you to fetch data or perform other tasks that do not require server-side rendering, such as generating static pages with data from an API or a file system. The results of getStaticProps are passed to the page as props and are available at runtime.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getStaticPaths&lt;/code&gt; is a function that is used in conjunction with getStaticProps to generate static pages for dynamic routes.To generate static pages for dynamic routes, you need to specify the values of the variable component that you want to pre-render. You can do this by implementing the getStaticPaths function in your page file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In general, you should use &lt;code&gt;getServerSideProps&lt;/code&gt; when you need to perform server-side rendering, such as with authenticated content or a database. You should use &lt;code&gt;getStaticProps&lt;/code&gt; when you need to generate static pages, such as with data from an API or a file system, &lt;code&gt;getStaticPaths&lt;/code&gt; to create and return list of dynamic paths on build time . You should avoid using &lt;code&gt;getInitialProps&lt;/code&gt; if you are using a version of Next.js newer than 9.3.&lt;/p&gt;
&lt;p&gt;By using these lifecycle methods, you can control the data and behavior of your pages in a Next.js application and optimize the rendering process for different scenarios.&lt;/p&gt;
&lt;p&gt;Here is an example of a page file with all lifecycle methods&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// pages/posts/[id].js&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Server Side fetch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;node-fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;Posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Hello, world!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Welcome to my Next.js application.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// This gets called on every request&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getServerSideProps&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Fetch data from external API&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://.../data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Pass data to the page via props&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; props&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// This function gets called at build time&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getStaticPaths&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Call an external API endpoint to get posts&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://.../posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Get the paths we want to pre-render based on posts&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/posts/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// We&amp;#39;ll pre-render only these paths at build time.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// { fallback: false } means other routes should return 404.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; fallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// This also gets called at build time&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getStaticProps&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// params contains the post `id`.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// If the route is like /posts/1, then params.id is 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;https://.../posts/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Pass post data to the page via props&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; props&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Posts&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;11&quot;&gt;
&lt;li&gt;Finally Next also provides a way to create api routes. Create &lt;code&gt;api&lt;/code&gt; folder inside &lt;code&gt;pages&lt;/code&gt; and inside this create &lt;code&gt;apiRoute.js&lt;/code&gt;. Here you can default export a function to handle api calls to &lt;code&gt;/api/apiRoute.js&lt;/code&gt;. Inside the function we can use switch case statement to handle api methods like GET, POST.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;handler&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;req&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;POST&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;John Doe&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;GET&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;John Doe&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;12&quot;&gt;
&lt;li&gt;To build your Next.js app for production, run the npm run build command and then the npm run start command to start the production server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Overall next.js is a good to go if your application involves lots of dynamic rendering and routing but you also want to use server side rendering to improve page performance and seo.&lt;/p&gt;
&lt;h4&gt;4. Gatsby&lt;/h4&gt;
&lt;p&gt;Gatsby.js is a static site generator for React that allows you to build fast and modern websites. It comes GraphQL out of the box to access data. GraphQL allows you to declaratively express your data needs. This is done with queries, queries are the representation of the data you need.&lt;/p&gt;
&lt;p&gt;GraphQL is certainly not required, but the benefits of adopting GraphQL are significant. GraphQL will simplify the process of building and optimizing your pages, so it’s considered a best practice for structuring and writing Gatsby applications.&lt;/p&gt;
&lt;p&gt;One of the key benefits of Gatsby.js is it let’s you create multiple pages using a single template on build time.
In &lt;code&gt;gatsby-node.js&lt;/code&gt;, you can use the GraphQL query to generate pages.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createPages&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;graphql&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;actions&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;reporter&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;createPage&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;actions&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Define a template for blog post&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;blogPost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./src/templates/blog-post.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Get all markdown blog posts sorted by date&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;graphql&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        allMarkdownRemark(sort: { frontmatter: { date: DESC } }, limit: 1000) {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          nodes {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;            fields {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;              slug&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;            }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;            frontmatter {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;              title&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;            }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;errors&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;reporter&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;panicOnBuild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;There was an error loading your blog posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;errors&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;allMarkdownRemark&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;nodes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Create blog posts pages&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// But only if there&amp;#39;s at least one markdown file found at &amp;quot;content/blog&amp;quot; (defined in gatsby-config.js)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// `context` is available in the template as a prop and as a variable in GraphQL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;previous&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;posts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createPage&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;slug&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;blogPost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        context&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          slug&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;slug&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;previous&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It uses server-side rendering and code splitting to deliver fast initial load times and smooth navigations. It also includes optimized image loading and automatic asset optimization to further improve the performance of your site.&lt;/p&gt;
&lt;p&gt;Gatsby.js also offers a rich developer experience with features such as hot reloading, error debugging, and integration with popular tools and libraries.
You can also use Gatsby’s plugin system to extend the functionality of your site with features such as analytics, SEO, or social media integration.&lt;/p&gt;
&lt;p&gt;Gatsby.js also provides a flexible and powerful routing system that allows you to define the routes and corresponding pages of your site. You can create static pages or use dynamic routes to render different content for different URLs.&lt;/p&gt;
&lt;p&gt;In addition to its core features, Gatsby.js has a vibrant and active community that maintains a wide variety of plugins and themes to help you build your site. You can use these resources to quickly add functionality or customize the appearance of your site.&lt;/p&gt;
&lt;h4&gt;How to start?&lt;/h4&gt;
&lt;p&gt;To setup gatsby project you can choose from &lt;strong&gt;Gatsby Starter Library&lt;/strong&gt; which provides multiple starter projects with different frameworks integration out of the box.
&lt;a href=&quot;https://www.gatsbyjs.com/starters/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.gatsbyjs.com/starters/&lt;/a&gt; or we can you gatsby’s Quick Start Guide &lt;a href=&quot;https://www.gatsbyjs.com/docs/quick-start/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.gatsbyjs.com/docs/quick-start/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Gatsby also have a next.js like approach for routing where we create a &lt;code&gt;.js&lt;/code&gt; files in &lt;code&gt;pages&lt;/code&gt; directory and export default the React component and then that component will be exposed to &lt;code&gt;/&amp;#x3C;filename&gt;&lt;/code&gt; route. In addition to this we can export a &lt;code&gt;Head&lt;/code&gt; function from the file and return from that function will be injected to &lt;code&gt;head&lt;/code&gt; tag of the page.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I have used Gatsby to create this blog site.&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;Why Gatsby?&lt;/h4&gt;
&lt;p&gt;Gatsby is all about speed: well-optimized websites with great SEO and performance and great ramp-up speed to build the app. It generates static HTML in advance, which can subsequently be stored on CDNs (Content Delivery Network) across the globe to facilitate quicker access.&lt;/p&gt;
&lt;p&gt;One best thing I like about gatsby is its &lt;a href=&quot;https://www.gatsbyjs.com/plugins&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;plugin&lt;/a&gt; ecosystem where you can get a plugin for almost anything.&lt;/p&gt;
&lt;p&gt;From transforming markdown to html, adding &lt;code&gt;_target&lt;/code&gt; to external routes. Ahead caching internal routes created by markdown, Adding custom meta tags, Generating RSS Feed you will get a plugin for the task you want to do or to extend its functionality.&lt;/p&gt;
&lt;p&gt;Overall, Gatsby.js is a powerful and flexible tool for building fast and modern websites with React. Whether you are building a blog, portfolio, or e-commerce site, Gatsby.js has the tools and resources you need to create a high-performing and scalable site.&lt;/p&gt;
&lt;h4&gt;5. Remix.run&lt;/h4&gt;
&lt;p&gt;Remix is fullstack React frameworks similar to next.js but with its own unique features and benefits. Originally offered as a paid subscription service, the creators of Remix announced in&lt;code&gt; October 2021&lt;/code&gt; that the framework would be made open source.&lt;/p&gt;
&lt;p&gt;One key feature of Remix is its focus on server-side rendering (SSR). This means that the backend and frontend of an application can be built using a single Remix app. Instead of fetching data on the frontend and rendering it on the screen, as is the case with vanilla React, Remix fetches data on the backend and serves the HTML directly to the user. This approach has the benefit of minimizing the amount of JavaScript that is required on the client side, resulting in faster page loads and a more efficient user experience.&lt;/p&gt;
&lt;p&gt;But wait next is also doing same thing so what’s the difference. Why would I use Remix instead of Next.&lt;/p&gt;
&lt;p&gt;Well Co-Founder of Remix Ryan Florence has written a detailed blog on this topic. You can read it &lt;a href=&quot;https://remix.run/blog/remix-vs-next&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this blog he has listed following advantages of using Remix over Next.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Remix is as fast or faster than Next.js at serving static content&lt;/li&gt;
&lt;li&gt;Remix is faster than Next.js at serving dynamic content&lt;/li&gt;
&lt;li&gt;Remix enables fast user experiences even on slow networks&lt;/li&gt;
&lt;li&gt;Remix automatically handles errors, interruptions, and race conditions, Next.js doesn’t&lt;/li&gt;
&lt;li&gt;Next.js encourages client side JavaScript for serving dynamic content, Remix doesn’t&lt;/li&gt;
&lt;li&gt;Next.js requires client side JavaScript for data mutations, Remix doesn’t&lt;/li&gt;
&lt;li&gt;Next.js build times increase linearly with your data, Remix build times are nearly instant and decoupled from data&lt;/li&gt;
&lt;li&gt;Next.js requires you to change your application architecture and sacrifice performance when your data scales&lt;/li&gt;
&lt;li&gt;We think Remix’s abstractions lead to better application code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One of the standout features of Remix is its support for &lt;a href=&quot;https://remix.run/docs/en/v1/guides/routing&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;nested routing&lt;/a&gt;. Nested routing refers to the idea of linking segments of the URL to the component hierarchy in the user interface. This has a number of benefits, as it allows developers to use the URL to control things like which layouts are rendered on the page, which JavaScript bundles are loaded, and what data dependencies those layouts have.&lt;/p&gt;
&lt;p&gt;In contrast to some web applications that fetch data inside of components, which can result in slower page loads and a less smooth user experience, Remix loads data in parallel on the server and sends a fully formed HTML document to the client. This helps to improve the performance and efficiency of the application, as it minimizes the amount of data that needs to be transferred over the network and reduces the number of requests that need to be made.&lt;/p&gt;
&lt;p&gt;You can follow &lt;a href=&quot;https://remix.run/docs/en/v1/tutorials/blog&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://remix.run/docs/en/v1/tutorials/blog&lt;/a&gt; this blog to setup the remix project.&lt;/p&gt;
&lt;h4&gt;6. Create React App&lt;/h4&gt;
&lt;p&gt;This one is the most commonly used tool on the list, but probably the last choice for a real-world production application.&lt;/p&gt;
&lt;p&gt;Create React App is a command-line tool that allows you to quickly create and set up a new React application. It is developed and maintained by the React team and is the easiest way to create a new React application.&lt;/p&gt;
&lt;p&gt;Using Create React App, you can create a new React application with just a few commands. It will automatically set up a development environment for you, including installing the necessary dependencies, configuring Webpack and Babel, and creating a development server.&lt;/p&gt;
&lt;p&gt;One of the key benefits of Create React App is its simplicity. It abstracts away many of the complexities of setting up a React application, allowing you to focus on building your application instead of worrying about the underlying configuration.&lt;/p&gt;
&lt;p&gt;Create React App will abstract the config and provide support of&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Importing svg as component&lt;/li&gt;
&lt;li&gt;Sass, Just need to install sass compiler.&lt;/li&gt;
&lt;li&gt;Testing with Jest and React Testing Library.&lt;/li&gt;
&lt;li&gt;Latest React Features like using &lt;code&gt;React.lazy&lt;/code&gt; for code splitting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Create React app is good option if creating &lt;code&gt;admin dashboards&lt;/code&gt; where seo is not important and focus is on shipping product quickly instead of website optimization.&lt;/p&gt;
&lt;p&gt;To create a new react app follow these steps&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;bash&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;npx create-react-app my-app&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; my-app&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;npm install&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;npm start&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create React App also provides option to add &lt;code&gt;typescript&lt;/code&gt; and to change package manager to &lt;code&gt;yarn&lt;/code&gt; instead of &lt;code&gt;npm&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;npx create-react-app my-app --template typescript&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will generate a typescript project.&lt;/p&gt;
&lt;p&gt;In addition, the structure of a React app created with Create React App is consistent across projects, which makes it easier to switch between different React projects and understand how they are organized.&lt;/p&gt;
&lt;h4&gt;7. Vite&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://vitejs.dev/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Vite&lt;/a&gt; is a modern build tool for JavaScript applications that allows you to quickly set up and develop a new project. It is designed to be fast and lightweight, making it an excellent choice for building React applications.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I personally prefer vite over cra as dev build time is too fast in vite. &lt;a href=&quot;https://israelmitolu.hashnode.dev/why-you-should-ditch-create-react-app-for-vite&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Around 10x fast&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h5&gt;Why Vite is fast&lt;/h5&gt;
&lt;p&gt;At its core, Vite does 2 things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Serve your code locally during development.&lt;/li&gt;
&lt;li&gt;Bundle your Javascript, CSS and other assets together for production.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are other tools(bundlers) that do the same thing, such as webpack, Parcel and Rollup, so what makes Vite different?&lt;/p&gt;
&lt;p&gt;The problem with the tools mentioned above is that they have to build everything on every save, and if you have a very large application, that could take several minutes every time you save, even with Hot reloading in some frameworks, the update speed gets significantly slower as you add more code and dependencies to the app.&lt;/p&gt;
&lt;p&gt;Vite has taken a different approach to this, kind of a reverse approach. Vite starts the server right away, takes the dependencies that don’t change often, and pre-bundles them using &lt;code&gt;esbuild&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Vite uses route-based code-splitting to figure out what parts of the code actually need to be loaded, and doesn’t have to pre-bundle everything.&lt;/p&gt;
&lt;p&gt;Vite serves the source code using native ES Module support in modern browsers. This lets the browser take the job of bundling in development, which consequently makes your code to load instantly, no matter how large the app is.&lt;/p&gt;
&lt;p&gt;It also supports Hot Module Replacement for an extremely fast feedback loop during development.&lt;/p&gt;
&lt;p&gt;When building for production, Vite uses &lt;code&gt;Rollup&lt;/code&gt; under the hood, so you don’t have to worry about configuring it.&lt;/p&gt;
&lt;h5&gt;Creating a Project with Vite&lt;/h5&gt;
&lt;p&gt;To create a Vite application, open your terminal and navigate to the folder where you want to save the Vite program. Then run this command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm create vite@latest&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You’ll be prompted to select a framework and a variant(template). In our case, we’ll be using React, so select React.&lt;/p&gt;
&lt;p&gt;You can also directly specify the template you want to use and the project name in one single line:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm create vite@latest react-app --template react&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Next, run the following commands in the terminal&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;cd react-app&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;npm install&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;npm run dev&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running the above command will start the development server. Then open your browser and enter &lt;a href=&quot;http://localhost:3000&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;http://localhost:3000&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Vite is faster then cra but is relatively new and don’t have that much community compared to cra. But it’s a good option if you are creating a side project in react as it comes with various templates and also support &lt;a href=&quot;https://vitejs.dev/guide/ssr.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;server side rendering&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Apart from react you can generate projects in several other frameworks also. &lt;a href=&quot;https://vitejs.dev/guide/#trying-vite-online&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://vitejs.dev/guide/#trying-vite-online&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;There we go! We’ve looked at 7 different methods for generating a React Project. Each with its own pros and cons.
Now that you have a better understanding of the options available to you, you can choose the best method for creating your &lt;em&gt;next big thing&lt;/em&gt;.
I hope this article was helpful in your decision-making process.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-11 { color: #8190A0; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-19 { color: #333333FF; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Create React project without CRA(or any build tool)]]></title><description><![CDATA[Creating a project from scratch can help you better understand the underlying technologies and tools that are being used in your project. By setting up the project yourself, you will gain a deeper understanding of how the different pieces fit together and how they work, which can be valuable knowledge to have as you develop and maintain your project. It also gives you the opportunity to learn and experiment with new technologies and approaches.]]></description><link>https://codeentity.tech/create-react-project-without-cra/</link><guid isPermaLink="false">https://codeentity.tech/create-react-project-without-cra/</guid><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 13 May 2022 12:11:44 GMT</pubDate><content:encoded>&lt;h4&gt;But why? Can’t we use CRA or other similar tools.&lt;/h4&gt;
&lt;p&gt;While CRA can be a useful tool for quickly getting started with a new React project, creating a project from scratch has several advantages that can be valuable for developers who want more control, a deeper understanding of their project, or the opportunity to try out new technologies and approaches.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Creating a React project from scratch has several advantages over using a tool like Create React App (CRA).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;One of the main advantages is that it gives you more control over the project setup and configuration. When you use CRA, the tool handles a lot of the setup and configuration for you, which can be convenient. However, this also means that you have less control over how the project is set up and how it is built.&lt;/p&gt;
&lt;p&gt;On the other hand, when you create a project from scratch, you have the opportunity to fully customize the project setup and build process to suit your needs. This can be particularly useful if you have specific requirements or preferences for how your project should be set up, or if you want to use a particular build tool or configuration that is not supported by CRA.&lt;/p&gt;
&lt;p&gt;Another advantage of creating a project from scratch is that it can help you better understand the underlying technologies and tools that are being used in your project. By setting up the project yourself, you will gain a deeper understanding of how the different pieces fit together and how they work, which can be valuable knowledge to have as you develop and maintain your project.&lt;/p&gt;
&lt;p&gt;Finally, creating a project from scratch also gives you the opportunity to learn and experiment with new technologies and approaches. While CRA is a convenient tool that can help you get started quickly, it may not always support the latest technologies or best practices. By creating a project from scratch, you can try out new tools and approaches and see how they work in your project.&lt;/p&gt;
&lt;h4&gt;Before we start&lt;/h4&gt;
&lt;p&gt;Before starting, you need to set up the environment:&lt;/p&gt;
&lt;h5&gt;Installing Node.js&lt;/h5&gt;
&lt;p&gt;Node.js is an open-source, cross-platform runtime environment that helps us write JavaScript applications and execute them.&lt;/p&gt;
&lt;p&gt;Node &gt;=18.0.0
You can get it from: &lt;a href=&quot;https://nodejs.org/en/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://nodejs.org/en/&lt;/a&gt;.
This will also install the npm (node package manager).&lt;/p&gt;
&lt;h5&gt;IDE&lt;/h5&gt;
&lt;p&gt;To start coding with React, we can use the Visual Studio Code IDE which can be downloaded from: &lt;a href=&quot;https://code.visualstudio.com/download&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://code.visualstudio.com/download&lt;/a&gt;. I personally prefer vscode but you can use any text editor of your choice like atom, webstorm, sublime.&lt;/p&gt;
&lt;h4&gt;Let’s Start&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;To generate a React project without using any tooling, you can follow these steps:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new directory for your project and navigate to it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Initialize a new npm package by running &lt;code&gt;npm init&lt;/code&gt; and following the prompts. This will create a package.json file in your project directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the React and ReactDOM packages by running npm install react react-dom. This will add the React and ReactDOM packages to your project as dependencies and update the package.json file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create an &lt;code&gt;index.html&lt;/code&gt; file in your project directory and add the following content:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;html&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;en&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;UTF-8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;X-UA-Compatible&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;IE=edge&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;viewport&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;width=device-width, initial-scale=1.0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;React CDN&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;index.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;5&quot;&gt;
&lt;li&gt;Create an &lt;code&gt;index.js&lt;/code&gt; file in your project directory and add the following content:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/node_modules/react/umd/react.development.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/node_modules/react-dom/umd/react-dom.development.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hello world!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;ReactDOM&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;6&quot;&gt;
&lt;li&gt;
&lt;p&gt;Run a local development server by installing a tool such as http-server and running http-server in your project directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open your browser and navigate to the URL of your local development server to view your React app.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now let’s enhance this by using &lt;code&gt;babel&lt;/code&gt; to transpile ths &lt;code&gt;.jsx&lt;/code&gt; syntax and &lt;code&gt;webpack&lt;/code&gt; to generate dev and prod bundles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To enhance the project that using webpack and Babel, we can follow these steps:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the webpack and webpack-cli packages by running &lt;code&gt;npm install --save-dev webpack webpack-cli&lt;/code&gt;. This will add the webpack and webpack-cli packages to your project as development dependencies and update the package.json file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the Babel packages by running&lt;code&gt;npm install --save-dev @babel/core @babel/preset-env @babel/preset-react babel-loader&lt;/code&gt;. This will add the Babel packages to your project as development dependencies and update the package.json file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;code&gt;webpack.config.js&lt;/code&gt; file in your project directory and add the following content:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  entry&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./index.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  output&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    filename&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;bundle.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    rules&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        test&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        exclude&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;node_modules&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        use&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;babel-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          options&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            presets&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;@babel/preset-env&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;@babel/preset-react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This configuration tells webpack to use the babel-loader to transpile your JavaScript code using the Babel presets for environment and React.&lt;/p&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Modify the index.html file to include the bundle file generated by webpack:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;html&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;en&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;UTF-8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;X-UA-Compatible&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;IE=edge&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;viewport&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;width=device-width, initial-scale=1.0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;React CDN&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;&amp;lt;!-- Webpack will create build at this path --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;dist/bundle.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;5&quot;&gt;
&lt;li&gt;Modify the &lt;code&gt;package.json&lt;/code&gt; file to include the following scripts:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;json&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;scripts&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-8&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;webpack --mode production&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;6&quot;&gt;
&lt;li&gt;Modify &lt;code&gt;index.js&lt;/code&gt; to:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;ReactDOM&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react-dom/client&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Hello World&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;ReactDOM&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createRoot&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// React 18&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This script allow you to build your project for production using npm run build.&lt;/p&gt;
&lt;ol start=&quot;7&quot;&gt;
&lt;li&gt;Run &lt;code&gt;npm run build&lt;/code&gt; to build your project. This will generate &lt;code&gt;dist&lt;/code&gt; folder with &lt;code&gt;bundle.js&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;Now run &lt;code&gt;index.html&lt;/code&gt; using &lt;code&gt;http-server&lt;/code&gt; module or you can use &lt;code&gt;live server&lt;/code&gt; extension if you are using vscode.&lt;/li&gt;
&lt;li&gt;Let’s include html template file in webpack configuration to generate a complete prod ready bundle.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To include the HTML template in webpack configuration, you will need to use a webpack plugin called &lt;code&gt;html-webpack-plugin&lt;/code&gt;. This plugin allows you to specify an HTML template file that will be used to generate an HTML file for your application.&lt;/p&gt;
&lt;p&gt;To use the &lt;code&gt;html-webpack-plugin&lt;/code&gt;, you will first need to install it as a dependency for your project. You can do this by running the following command in your terminal:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install html-webpack-plugin --save-dev&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Once the html-webpack-plugin is installed, you can add it to your webpack configuration by adding the following code to your webpack.config.js file:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;html-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// other webpack configuration goes here&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  plugins&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      template&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;path/to/template.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      filename&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will tell webpack to use the specified HTML template file to generate an HTML file for your application. The generated HTML file will be placed in the output directory specified in your webpack configuration and will be served when your application is built and run.&lt;/p&gt;
&lt;p&gt;You can also use the html-webpack-plugin to customize the generated HTML file by specifying various options such as the title of the page, the favicon, and any metadata that should be included in the head of the HTML file. For more information on the options available for the html-webpack-plugin, you can refer to the &lt;a href=&quot;https://webpack.js.org/plugins/html-webpack-plugin/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;plugin’s documentation&lt;/a&gt;.&lt;/p&gt;
&lt;ol start=&quot;10&quot;&gt;
&lt;li&gt;Run &lt;code&gt;npm run build&lt;/code&gt; to build your project. This will generate &lt;code&gt;dist&lt;/code&gt; folder with &lt;code&gt;bundle.js&lt;/code&gt; and &lt;code&gt;index.html&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;You can run this &lt;code&gt;index.html&lt;/code&gt; similarly using &lt;code&gt;http-server&lt;/code&gt; module or you can use &lt;code&gt;live server&lt;/code&gt; extension.&lt;/li&gt;
&lt;li&gt;There’s something still pending in this config which is we can not import css files to project.&lt;/li&gt;
&lt;li&gt;To setup this install style loader and css loader by running &lt;code&gt;npm install --save-dev style-loader css-loader&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Now add this to webpack config by making following changes.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Add this to rules array in module object.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  test&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  use&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;style-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;css-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;15&quot;&gt;
&lt;li&gt;Create a &lt;code&gt;style.css&lt;/code&gt; file and add some styles in it.&lt;/li&gt;
&lt;li&gt;Import this file in &lt;code&gt;index.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Repeat step 8 &amp;#x26; 9. You will see the css changes applied. But this will add changes in js bundle and webpack will inject these as style tag on run time.&lt;/li&gt;
&lt;li&gt;To extract css into separate file we can use &lt;a href=&quot;https://webpack.js.org/plugins/mini-css-extract-plugin/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;MiniCssExtractPlugin&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;But it’s not practical to build the project after making a single change. So we will setup a dev mode using &lt;code&gt;webpack-dev-server&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install Webpack Dev Server using &lt;code&gt;npm install --save-dev webpack-dev-server&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;webpack.config.dev.js&lt;/code&gt; and add following code.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;8&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;html-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  entry&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./index.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  output&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    filename&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;bundle.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    rules&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        test&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        exclude&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;node_modules&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        use&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;babel-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          options&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            presets&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;@babel/preset-env&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;@babel/preset-react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        test&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        use&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;style-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;css-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  plugins&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      template&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./src/index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  devServer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    historyApiFallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  devtool&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;source-map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;
&lt;p&gt;We have some extra properties in this config.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;historyApiFallback&lt;/code&gt;: The development server will use the historyApiFallback option to support client-side routing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;source-map&lt;/code&gt;: The source-map option will generate source maps for the output bundle to facilitate debugging.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This configuration file can be used with the &lt;code&gt;webpack-dev-server&lt;/code&gt; to start a development server for project. To use this add following script to &lt;code&gt;package.json&lt;/code&gt;.
&lt;code&gt;&quot;start&quot;: &quot;webpack-dev-server --mode development --config  webpack.config.dev.js&quot;&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run &lt;code&gt;npm run start&lt;/code&gt; or &lt;code&gt;npm start&lt;/code&gt; to start the development server and view your React app. Webpack will automatically transpile your code using Babel and reload the page when you make changes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Now we can change the folder structure a bit so that we can make it similar to conventional react project.&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a folder with name &lt;code&gt;public&lt;/code&gt; at root and move &lt;code&gt;index.html&lt;/code&gt; to this folder.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a folder with name &lt;code&gt;src&lt;/code&gt; at root and move &lt;code&gt;index.js&lt;/code&gt; and &lt;code&gt;styles.css&lt;/code&gt; to this folder.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Also we need to change these paths webpack and webpack dev config.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;9&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;entry&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./src/index.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;10&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;   template&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;public/index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;After this activity your folder structure should look like:&lt;/strong&gt;
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 311px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/52a71b7a0324402bddeddd1f463b9d82/ffa0f/folder.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 70.25316455696203%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAABJ0AAASdAHeZh94AAABtUlEQVR42p2TzW/aQBDFB5uEEmxj7Dh2EhAO9q69YMJHCBAMJFarKpWqHnqq1GPVc///06t2jdKqVQTkMLuj1exP783sUtVP0ejNYH78iTrP0UpzGPEC5MYgj4E8jspF8rLvC9LkEgwQPHxBKBYweA4jmqN6leHkengUTNVWPA5yGC5bbYw6IWpsAy8r4PRlPEIP+scBdV/AiscIPuXQekvU2kOQE4HOY9D5GyzrviwWyIoxlsUE+vVMQauXg6Ptlj30OcjiyCYxnp8Zqt01vGGBJlv9BzsETpWLFOSE0OP3qM++w7y5QzNZw4yXqHXGIDc6yjqRJxMGKx3jLJorWEtsYPEHNHr3qHVGKg4dDskiLUjgjfowelMFlNNtJisY0ULl7uBJQaXSUuUehZqfoClinN1MYHEJ3MJOcgU/uRqA7PAf6/xVtTuFAuzDV2XTTtaw09K27KMR3eNdd4J6d7p76HyfwhI4/PwDJvsDNNkKjWgOR2zgZk/q3GKrw4Cy4Ytvv2Cnm5eetcRWAdz+Fm5WlENxo93FPZZlUg+n6v+etm9x2h4pe+V/zpRdzRd/vcfXFf4GunRtBT7CgbcAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Folder Structure&quot;
        title=&quot;Folder Structure&quot;
        src=&quot;/static/52a71b7a0324402bddeddd1f463b9d82/ffa0f/folder.png&quot;
        srcset=&quot;/static/52a71b7a0324402bddeddd1f463b9d82/c26ae/folder.png 158w,
/static/52a71b7a0324402bddeddd1f463b9d82/ffa0f/folder.png 311w&quot;
        sizes=&quot;(max-width: 311px) 100vw, 311px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h5&gt;Now we need to have a way to copy static assets like fonts and images to the bundle folder&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To copy static assets such as images, fonts, or other media files using webpack, you can use the &lt;code&gt;copy-webpack-plugin&lt;/code&gt; and the &lt;code&gt;file-loader&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install --save-dev  copy-webpack-plugin&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is an example of how to use the copy-webpack-plugin to copy static assets in your webpack configuration file:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;11&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;CopyWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;copy-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// your webpack configuration goes here&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  plugins&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;CopyWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      patterns&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          to&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// This will be the path you will use to import the file. For eg. /assets/image.png&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          globOptions&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            ignore&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;**/index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Ignore index.html file&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This configuration will copy all files from the &lt;code&gt;public&lt;/code&gt; directory to the assets directory in the output directory.
Now you can import the files present in public folder using absolute path directly in &lt;code&gt;image src or in css url&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy an &lt;code&gt;image.png&lt;/code&gt; file to &lt;code&gt;public folder&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Change element variable in &lt;code&gt;index.js&lt;/code&gt; to&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;12&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Hello World&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/* Src path will be the path you will give in `to` property in config */&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/assets/image.png&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Restart the server and you will see and image in browser.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;copy-webpack-plugin is not designed to copy files generated from the build process; rather, it is to copy files that already exist in the source tree, as part of the build process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This means that if we want to import images dynamically into &lt;code&gt;.js&lt;/code&gt; or &lt;code&gt;.css&lt;/code&gt; we can not use this.
For that we need to use &lt;code&gt;file-loader&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install --save-dev file-loader&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Copy following code to &lt;code&gt;webpack.config.dev.js&lt;/code&gt; rules array.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;13&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  test&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;png&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;jpg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;gif&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;svg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  use&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;file-loader&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  options&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;[name].[ext]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    outputPath&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;assets/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you can import image file to js file using import syntax.
Let’s try it out&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy a image file &lt;code&gt;image2.png&lt;/code&gt; to src folder.&lt;/li&gt;
&lt;li&gt;Import file in &lt;code&gt;index.js&lt;/code&gt; using following syntax.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;14&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./image.png&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Modify &lt;code&gt;img&lt;/code&gt; tag to use the imported file&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;15&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Hello World&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;img&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;image2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you can see the result in browser.&lt;/p&gt;
&lt;p&gt;To get a bit clarity how this works add a new image tag with src path from assets and run &lt;code&gt;npm run build&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Check the dist folder to how webpack is generating the final build.&lt;/p&gt;
&lt;h5&gt;At last&lt;/h5&gt;
&lt;p&gt;Now as a final step we can modify &lt;code&gt;webpack.config.js&lt;/code&gt; a bit to include versioning in the build process.
Webpack provides versioning support out of the box.&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;webpack.config.js&lt;/code&gt; modify &lt;code&gt;output.filename&lt;/code&gt; to &lt;code&gt;bundle.[hash].js&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Delete the dist folder and run &lt;code&gt;npm run build&lt;/code&gt;.
Webpack will generate bundle with a hash code.&lt;/p&gt;
&lt;p&gt;If you are pushing the code to git add &lt;code&gt;.gitignore&lt;/code&gt; file at root level and add following code&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;bash&quot; data-index=&quot;16&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;node_modules&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;dist&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will ignore the node_modules and dist folder as we don’t need to push these.&lt;/p&gt;
&lt;h4&gt;What Next&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;We can add &lt;code&gt;sass&lt;/code&gt; or &lt;code&gt;postcss&lt;/code&gt; support using loaders.&lt;/li&gt;
&lt;li&gt;Extract out css to separate bundles and hash css bundles also.&lt;/li&gt;
&lt;li&gt;Add &lt;a href=&quot;https://react-svgr.com/docs/webpack/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;svgr&lt;/a&gt; to import svg as react components.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/iamvishal345/react-from-scratch&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/iamvishal345/react-from-scratch?label=Fork%20Complete%20Project&amp;amp;style=social&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-11 { color: #8190A0; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-19 { color: #333333FF; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Heap Tree]]></title><description><![CDATA[A heap is a special type of tree-based data structure that satisfies the heap property: the value of each node is always greater than or equal to the value of its parent, with the exception of the root node, which has no parent. There are two types of heaps: min heaps and max heaps. In a min heap, the value of each node is always greater than or equal to the value of its parent, while in a max heap, the value of each node is always less than or equal to the value of its parent.]]></description><link>https://codeentity.tech/data-structure-js-tree-4/heap-tree/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-js-tree-4/heap-tree/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tree]]></category><category><![CDATA[Heap]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 22 Apr 2022 12:11:44 GMT</pubDate><content:encoded>&lt;h4&gt;What is a Heap Tree&lt;/h4&gt;
&lt;p&gt;A heap is a special type of tree-based data structure that satisfies the heap property: the value of each node is always greater than or equal to the value of its parent, with the exception of the root node, which has no parent. There are two types of heaps: min heaps and max heaps. In a min heap, the value of each node is always greater than or equal to the value of its parent, while in a max heap, the value of each node is always less than or equal to the value of its parent.&lt;/p&gt;
&lt;p&gt;Heaps are typically implemented using an array, where the parent and child nodes of each node are found using the following formulas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The index of the left child of a node at index i is 2 * i + 1&lt;/li&gt;
&lt;li&gt;The index of the right child of a node at index i is 2 * i + 2&lt;/li&gt;
&lt;li&gt;The index of the parent of a node at index i is (i - 1) / 2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;For example, consider the following min heap:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/6eec45e7ffd2b9dcb5093edc10a15fae/9a86a/heap_example.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 47.46835443037975%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAABJ0AAASdAHeZh94AAABNElEQVR42nWSWVODMBSF+f+/Rh0f7eiDOu46MBWxUBbpuHWaUhoIkHCchKVJx96XbN89uSc3FrRo23Ych7mM6ycfjpf2Z+a5zsmw9oWEaDEwDefINxku79/waPug2w2EEHusKWwduinPcxBCUFXVuFeWJQhZgVKKQ84svXyy3uLqwUOapmCMGQl6UllQzPwQN88BioIZjBLkvLMRJp84mThYkbVacyGMyhXbW47TLxyf2fhdrtRa9Kw1wFXFkGVSSCirbZ/4X5PkM+isEHzXFFmd7UYI5vG4KQFn+o558qPaOmjJKqZeglkQaZcJTN0Z/PhbzS1KSxxNXpEslp3N3v6Lm+L8LkRd7d6yZAynFx7CD5N1vAUmtxEYKzrLsmv6d5BR1zWKgmqWO1HJcs4NtmmasfN/NDy7W2x24TMAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Heap Example&quot;
        title=&quot;Heap Example&quot;
        src=&quot;/static/6eec45e7ffd2b9dcb5093edc10a15fae/f058b/heap_example.png&quot;
        srcset=&quot;/static/6eec45e7ffd2b9dcb5093edc10a15fae/c26ae/heap_example.png 158w,
/static/6eec45e7ffd2b9dcb5093edc10a15fae/6bdcf/heap_example.png 315w,
/static/6eec45e7ffd2b9dcb5093edc10a15fae/f058b/heap_example.png 630w,
/static/6eec45e7ffd2b9dcb5093edc10a15fae/9a86a/heap_example.png 792w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This heap can be represented as a Max Heap array as follows: &lt;code&gt;[20,12,18,8,11,7,5]&lt;/code&gt;
This heap can be represented as a Min Heap array as follows: &lt;code&gt;[5,11,7,20,18,12,8]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To insert a new element into a heap, we first add it to the end of the array and then percolate it up the heap until it is in the correct position. To do this, we compare the value of the new element with the value of its parent and swap them if necessary. This process is repeated until the heap property is satisfied.&lt;/p&gt;
&lt;p&gt;To remove the minimum (or maximum) element from a min (or max) heap, we remove the root node and replace it with the last element in the array. We then &lt;strong&gt;percolate&lt;/strong&gt; this element down the heap until it is in the correct position. To do this, we compare the value of the element with the values of its children and swap it with the smaller (or larger) child if necessary. This process is repeated until the heap property is satisfied.&lt;/p&gt;
&lt;p&gt;Heaps are commonly used for implementing priority queues, where the priority of each element is represented by its value in the heap. They are also used in algorithms for sorting and searching data, such as heap sort and Dijkstra’s algorithm.&lt;/p&gt;
&lt;p&gt;Overall, heaps are a useful data structure for efficiently storing and manipulating data in a tree-like structure, and they have many practical applications in computer science.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example implementation of a min heap class in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;MinHeap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParentIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getLeftChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getRightChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;hasParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParentIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;hasLeftChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getLeftChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;hasRightChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getRightChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParentIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getLeftChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getLeftChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getRightChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getRightChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;swap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;temp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;peek&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;throw&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Heap is empty&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;poll&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;throw&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Heap is empty&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;heapifyDown&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;item&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;heapifyUp&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;heapifyUp&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;hasParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;swap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParentIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getParentIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;heapifyDown&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;hasLeftChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;smallerChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getLeftChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;hasRightChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getRightChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getLeftChild&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      ) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;smallerChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getRightChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;smallerChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;swap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;smallerChildIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;smallerChildIndex&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of how you can use the MinHeap class to create a min heap tree:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;MinHeap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;heap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// [1, 5, 3, 8, 7, 9, 4]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;   \&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-4&quot;&gt;\ &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  \&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To create a max heap, you can use the same class but change the comparison operator (&amp;#x3C;) in the heapifyDown function to &gt; to ensure that the current node is swapped with the larger child.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Binary Search Tree]]></title><description><![CDATA[A binary search tree (BST) is a type of binary tree that is used for searching and sorting data. It is called a "search tree" because it can be efficiently used to search for the presence or absence of a particular element in the tree. It is called a "binary" tree because each node has at most two children.]]></description><link>https://codeentity.tech/data-structure-js-tree-4/binary-search-tree/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-js-tree-4/binary-search-tree/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tree]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Tue, 19 Apr 2022 12:11:44 GMT</pubDate><content:encoded>&lt;h4&gt;What is Binary Search Tree (BST)&lt;/h4&gt;
&lt;p&gt;A binary search tree (BST) is a type of binary tree that is used for searching and sorting data. It is called a “search tree” because it can be efficiently used to search for the presence or absence of a particular element in the tree. It is called a “binary” tree because each node has at most two children.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In a BST, the left child of a node is always less than the value of the node, and the right child is always greater than the value of the node.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This means that if we want to search for a particular value in the tree, we can start at the root node and then decide which direction to go based on whether the value we are looking for is less than or greater than the value of the current node. If the value is less than the current node, we go left; if it is greater, we go right. This process is repeated until we either find the value we are looking for or reach a null node, indicating that the value is not present in the tree.&lt;/p&gt;
&lt;p&gt;One of the main benefits of using a BST is that it allows us to search for values in O(log n) time, where n is the number of nodes in the tree. This is much faster than searching through an unsorted list, which takes O(n) time.&lt;/p&gt;
&lt;p&gt;Inserting and deleting elements from a BST is also relatively efficient. To insert a new element into the tree, we follow the same process as searching for a value, except that instead of stopping when we find the value we are looking for, we continue until we reach a null node. Then, we insert the new element as the left or right child of the node, depending on whether it is less than or greater than the value of the node. To delete a node from the tree, we need to find the node and then remove it while maintaining the BST property.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example implementation of a binary search tree class in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;TreeNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinarySearchTree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;TreeNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lookup&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Empty Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Not Found&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Empty Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmostParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmostParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmostParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinarySearchTree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;170&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lookup&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;TreeNode {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  left: TreeNode { left: null, right: null, value: 15 },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  right: TreeNode { left: null, right: null, value: 170 },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  value: 20&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lookup&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Not Found&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; * {&amp;quot;value&amp;quot;:9,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; *  &amp;quot;left&amp;quot;:{&amp;quot;value&amp;quot;:4,&amp;quot;left&amp;quot;:{&amp;quot;value&amp;quot;:1,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null}, &amp;quot;right&amp;quot;:{&amp;quot;value&amp;quot;:6,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null}},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; *  &amp;quot;right&amp;quot;:{&amp;quot;value&amp;quot;:20,&amp;quot;left&amp;quot;:{&amp;quot;value&amp;quot;:15,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null},&amp;quot;right&amp;quot;:{&amp;quot;value&amp;quot;:170,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null}}}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//     9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//  4     20&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//1  6  15  170&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;BSTs are commonly used in a variety of applications, such as&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implementing associative arrays&lt;/li&gt;
&lt;li&gt;Representing mathematical expressions&lt;/li&gt;
&lt;li&gt;Storing data in databases.&lt;/li&gt;
&lt;li&gt;Algorithms for sorting and searching data, such as quicksort and merge sort.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Tree Traversal&lt;/h4&gt;
&lt;p&gt;Tree traversal is the process of visiting all the nodes in a tree in a specific order. There are three common types of tree traversal: inorder, preorder, and postorder.&lt;/p&gt;
&lt;p&gt;Tree traversal is often used to perform some operation on all the nodes of a tree, such as printing the values of the nodes or evaluating a mathematical expression represented by the tree. It can also be used to create a copy of a tree or to delete all the nodes of a tree.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In order to implement tree traversal, we can use either a recursive or an iterative approach.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Let’s consider following BST as an example&lt;/strong&gt;
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/fc9a078cc29f6ce8aed4b91b30a5b234/3534c/binary_tree_traversal.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 42.405063291139236%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAABJ0AAASdAHeZh94AAABJUlEQVR42nWRW0vDQBCF8/9/jC8+qGCRPhSEGrW2JSjRVlOrrbWbzc1cNvvJJk1IpB5YBuZy5sxZC0BrTRO7r8H4YcH5cGY6/u1rokUHXRKDNM0IAon3vsVdfiJ9nyRJ+IvunNXfpFFFTpZlSCkJpEQp1RsMwxBfCNL0h6LITZKar+awuhvM8OlgymTmosuiR9RTrzWLpcfJxT27fVilylJ3FdZ9URRhTxes1tuj53SJ98JnPHlm+/Vd1w711sMkjqozDbI0RQgBWh1RaM4OquUGcRxVPjcfZkGJPXvjajStzjwo58ldcjacE4ZRq7BUisHI4dp2DhbVzTd3DpcjhyLPa8LHlw3u66411sCXMfZ8RRwnPcKJs8L7ED3f1hvB7dxDFQW/I8JsizZZmlkAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Binary Search Tree Example&quot;
        title=&quot;Binary Search Tree Example&quot;
        src=&quot;/static/fc9a078cc29f6ce8aed4b91b30a5b234/f058b/binary_tree_traversal.png&quot;
        srcset=&quot;/static/fc9a078cc29f6ce8aed4b91b30a5b234/c26ae/binary_tree_traversal.png 158w,
/static/fc9a078cc29f6ce8aed4b91b30a5b234/6bdcf/binary_tree_traversal.png 315w,
/static/fc9a078cc29f6ce8aed4b91b30a5b234/f058b/binary_tree_traversal.png 630w,
/static/fc9a078cc29f6ce8aed4b91b30a5b234/3534c/binary_tree_traversal.png 808w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Inorder traversal:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In an inorder traversal, we first visit the left child of a node, then the node itself, and then the right child. This means that the nodes of the tree are visited in the order: left child, root, right child.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;inorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;inorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;inorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For Above BST Inorder traversal array would be : &lt;code&gt;[9,11,12,18,20,21,22]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Preorder traversal:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In a preorder traversal, we first visit the root node, then the left child, and then the right child. This means that the nodes of the tree are visited in the order: root, left child, right child.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;preorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;preorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;preorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For Above BST preorder traversal array would be : &lt;code&gt;[18,11,9,12,21,20,22]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Postorder traversal:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In a postorder traversal, we first visit the left child, then the right child, and then the root node. This means that the nodes of the tree are visited in the order: left child, right child, root.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;postorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;postorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;postorderTraversal&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For Above BST preorder traversal array would be : &lt;code&gt;[9,12,11,20,22,21,18]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It’s also possible to implement these tree traversal functions using an iterative approach rather than a recursive one. The iterative approach involves using a stack to keep track of the nodes that need to be visited. Here is an example of an iterative inorder traversal function:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;inorderTraversalIterative&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Similar iterative approaches can be used for preorder and postorder traversal as well.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;In conclusion, binary search trees (BSTs) are a type of binary tree data structure that are used for searching and sorting data. They are called &lt;strong&gt;search trees&lt;/strong&gt; because they can be efficiently used to search for the presence or absence of a particular element in the tree, and they are called &lt;strong&gt;binary trees&lt;/strong&gt; because each node has at most two children. BSTs are characterized by the property that the left child of a node is always less than the value of the node, and the right child is always greater than the value of the node. This allows us to search for values in &lt;strong&gt;O(log n)&lt;/strong&gt; time, where n is the number of nodes in the tree. BSTs are also relatively efficient for inserting and deleting elements, making them a useful data structure for storing and manipulating data in a hierarchical manner.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Binary Tree]]></title><description><![CDATA[A binary tree is a tree data structure in which each node has at most two children. Binary trees are commonly used to implement search algorithms, such as binary search.]]></description><link>https://codeentity.tech/data-structure-js-tree-4/binary-tree/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-js-tree-4/binary-tree/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tree]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 17 Apr 2022 10:11:44 GMT</pubDate><content:encoded>&lt;h5&gt;What is a Binary Tree&lt;/h5&gt;
&lt;p&gt;A binary tree is a data structure that consists of nodes arranged in a tree-like structure. Each node has at most two children, referred to as the left child and the right child. The node at the top of the tree is called the root, and the nodes at the bottom of the tree are called leaves.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/988ffc8a1eb5a981e34f57bebe1e1f08/c1b63/binary_tree.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 106.32911392405065%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAAAsTAAALEwEAmpwYAAABLUlEQVR42rWUAU+DMBSEvzLo1A1kAk42cYr//z+aJtfk2SAQxUsISft6vd69FpaRA0dgxwYIJFegA56B7K+EBXABvAiLLQg/pXDcgvAFuDNeXn5DEhbWwABUydwBeNf46pDC8RqpOyZzgeisr1lDlonwASilNMDp3+gLhO0SWVx0lbpR6aY1Uf2wRuG92dlLyU8o51Tu5M+bURrwZPpwCo1IH21LOfnWafE+Ge+T8bQjRpH28SblugWldqxMU3dS2U4kbm2ptWlh+6uf8KSVDR8z93hQkIeplklx1gkq+UTicaYatybxUse11zBPampj0SxpKLzJw4hX2VIZO0LNaUmZl8HR19yMdVJ6MkG2M231zZfYCs48tL2IvAmxW/tS14lnXsHE8PaqcfwnvgDgEAqk5GC3nAAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Binary Tree&quot;
        title=&quot;Binary Tree&quot;
        src=&quot;/static/988ffc8a1eb5a981e34f57bebe1e1f08/f058b/binary_tree.png&quot;
        srcset=&quot;/static/988ffc8a1eb5a981e34f57bebe1e1f08/c26ae/binary_tree.png 158w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/6bdcf/binary_tree.png 315w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/f058b/binary_tree.png 630w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/40601/binary_tree.png 945w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/c1b63/binary_tree.png 1200w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Binary trees can be implemented in many different ways, depending on the requirements of the application. One common way to implement a binary tree is to use a class with fields for the data stored at the node and references to the left and right children of the node.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example implementation of a binary tree class in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinaryTreeNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinaryTree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinaryTreeNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;_remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;_remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;_remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;_remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;_findMin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;_remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinaryTree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// BinaryTreeNode { data: 12, left: null, right: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// BinaryTreeNode { data: 6, left: null, right: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;47&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Not Found&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Not Found&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Binary trees have several properties that make them useful for certain types of problems. One property is that the height of a binary tree is logarithmic in the number of nodes it contains. This means that as the number of nodes in the tree increases, the height of the tree grows at a slower rate. This property makes binary trees well-suited for searching and sorting operations, as the time complexity of these operations is often related to the height of the tree.&lt;/p&gt;
&lt;p&gt;There are several different types of binary trees, each with its own characteristics. Some common types of binary trees include:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Binary search tree&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A binary search tree is a type of binary tree where the value of each node is greater than the values of the nodes in its left subtree and less than the values of the nodes in its right subtree. This property allows for efficient search and insertion operations, as the tree can be traversed in a way that narrows down the possible location of the desired value.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Complete binary tree&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A complete binary tree is a type of binary tree where all levels of the tree are fully filled except possibly the last level, and the nodes in the last level are filled from left to right.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Full binary tree&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A full binary tree is a type of binary tree where every node has either 0 or 2 children.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Perfect binary tree&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A perfect binary tree is a type of binary tree that is both complete and full.&lt;/p&gt;
&lt;p&gt;Binary trees are used for a variety of purposes, such as representing hierarchical relationships, searching, sorting, and decision-making. They can be implemented using a variety of techniques, including arrays, linked lists, and dynamic memory allocation.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;In conclusion, binary trees are a widely used data structure in computer science, with many practical applications in areas such as file systems, decision-making, web navigation, network routing, and expression parsing. They are implemented using a variety of techniques, including arrays, linked lists, and dynamic memory allocation. Binary trees can be traversed using various techniques, such as inorder, preorder, and postorder traversal, and they can be balanced using techniques such as red-black trees and AVL trees. Overall, binary trees are a powerful tool for organizing and manipulating data in a hierarchical manner.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Data Structure and Algorithms with JS - Part 4 : Tree]]></title><description><![CDATA[A tree is a non-linear data structure that consists of nodes organized in a hierarchical structure. Each node in a tree has one or more child nodes, and is referred to as the parent of its child nodes. The node at the top of the tree is called the root, and the nodes without children are called leaf nodes.]]></description><link>https://codeentity.tech/data-structure-js-tree-4/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-js-tree-4/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tree]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sat, 16 Apr 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;A tree&lt;/strong&gt; is a non-linear data structure that represents a hierarchical relationship between nodes. Each node in a tree has a value and can have zero or more child nodes, which are connected to it via edges. The node at the top of the tree is called the root node, and the nodes that do not have any children are called leaf nodes.&lt;/p&gt;
&lt;p&gt;The tree data structure is often used to represent hierarchical relationships in data, such as the structure of a file system, the structure of an organization, or the structure of a decision-making process.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some common terminologies used in the context of tree data structure:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Root&lt;/strong&gt;: The root of a tree is the topmost node in the tree. It is the ancestor of all other nodes in the tree.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Child&lt;/strong&gt;: A child of a node is a node that is directly connected to it via an edge. A node can have zero or more children, depending on the structure of the tree.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Parent&lt;/strong&gt;: A parent of a node is a node that is directly connected to it via an edge. Every node in a tree, except for the root, has a parent.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Leaf&lt;/strong&gt;: A leaf is a node that does not have any children. Leaf nodes are the terminal nodes of a tree.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subtree&lt;/strong&gt;: A subtree of a tree is a portion of the tree that includes a node and all of its descendants.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Ancestor&lt;/strong&gt;: An ancestor of a node is a node that is located above it in the tree and can be reached by traversing the tree upwards from the node. The root of the tree is an ancestor of every node in the tree.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Descendant&lt;/strong&gt;: A descendant of a node is a node that is located below it in the tree and can be reached by traversing the tree downwards from the node. Every node in the tree is a descendant of the root.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sibling&lt;/strong&gt;: Siblings are nodes that have the same parent.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Degree&lt;/strong&gt;: The degree of a node is the number of children it has.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Height&lt;/strong&gt;: The height of a tree is the number of edges on the longest downward path between the root and a leaf. The height of a node is the number of edges on the longest downward path between the node and a leaf.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Depth&lt;/strong&gt;: The depth of a node is the number of edges on the path from the root to the node.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Level&lt;/strong&gt;: The level of a node is the number of ancestors it has. The root of the tree is at level 0, and the children of the root are at level 1, and so on.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Path&lt;/strong&gt;: A path in a tree is a sequence of nodes connected by edges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Traversal&lt;/strong&gt;: Traversal refers to the process of visiting and processing the nodes of a tree in a specific order. There are various tree traversal algorithms, including&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Some characteristics of the tree data structure&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Hierarchical structure:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Trees have a hierarchical structure, with the root node at the top and the leaf nodes at the bottom. This structure allows for the representation of complex relationships between nodes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Recursive structure:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Trees have a recursive structure, with each node potentially having its own sub-tree of child nodes. This allows for the representation of an unbounded number of nodes within a tree.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Non-linear:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Trees are a non-linear data structure, meaning that the nodes in a tree are not stored in a contiguous block of memory like an array. Instead, each node is stored separately and is connected to other nodes via edges.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Efficient search:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Trees can be used to efficiently search for specific values within a dataset. For example, binary search trees allow for efficient search operations by exploiting the hierarchical structure of the tree.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Efficient insertion and deletion:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Trees can be used to efficiently insert and delete elements, particularly if the tree is balanced.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Flexible structure:&lt;/strong&gt;
Trees have a flexible structure, which allows them to adapt to changing data and changing requirements. For example we can have any number of child nodes to fit our requirements.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/354f82ddb73e0a8dd182de812c5efd1f/3cb0f/first_tree.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 60.12658227848101%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAABYlAAAWJQFJUiTwAAACQElEQVR42pWTy2tTQRTGf3Pv3Ofcm+TGpDdpU2Kf2rS1aPpSIdBSUNFF60aQgi1YanUhWPCBdFOFLkQUxIUupCLoWnEjiAv/BRf+CS7c+Fi4kHbkJqmloFgPHJjDzHx833fOgT+HFGDRSFNrRfOcB/ytYrdhAm1AwROUXEG0XsDplLjzKVy9D/mjB/rs/0AUwrZK0kiA0X2kN3qJElKXMzi6l7TuRZUlMnn6bzQjTIAKQDTgmPaLIuGFNJzw4UELPC/CnRxBxcYFEi9ioAXY5iyrm/jjmkPTGvq/Y85osZy11EKIN+hIeyYwGHFh1N0WsZIlSBk4gNdMo3FV1ZjVTdRRjT55HwZ/OqW25cxK1+mWxYx0n8aJXMvcQnrfDmdC/Ht5goQt20jNGNVQ01gHvwgmtDVVPKX6E/qpOY/yK7/Z8bApLW812FjTAepRXG+23OnZYU33rIahb97X/g5fd5F6UrCzn8ukFytrHoVVXyafjMBB2F4gVULIupvHfRyTaXoXNNOD9CXofK1q0X71Miblm8o57uPfytvu7Qwh7evBzQ8akT0L/jBWbr7O40pUFyplAzAF7CFRYh/RNrklNdSY1cR2+TCqz6LVAa5UY74c15ZoXbNEfE2ZPW9lOPCRc22Tvxu0Q7E/vGFR1c5g+YbaPNDnn4/C1inlDjwr5aI3XZ2KzHXTn9COyF+MCWoVo3U1EPFVRLz8lx0b0VTGfsAxbcxW37lze2ezY/nJ4lL3QtRT07YY0bY99Mnc7Vb8AneaZOrkbtuXAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Example of Tree Data structure&quot;
        title=&quot;Example of Tree Data structure&quot;
        src=&quot;/static/354f82ddb73e0a8dd182de812c5efd1f/f058b/first_tree.png&quot;
        srcset=&quot;/static/354f82ddb73e0a8dd182de812c5efd1f/c26ae/first_tree.png 158w,
/static/354f82ddb73e0a8dd182de812c5efd1f/6bdcf/first_tree.png 315w,
/static/354f82ddb73e0a8dd182de812c5efd1f/f058b/first_tree.png 630w,
/static/354f82ddb73e0a8dd182de812c5efd1f/3cb0f/first_tree.png 708w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h4&gt;There are several types of tree data structures, each with its own characteristics and use cases:&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;N-ary tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Trees can have more than two children per node, in which case they are called n-ary trees.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 504px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/18f3b27a2ed9e8343256b3acfbf326d0/08115/narytree.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 62.0253164556962%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7DAAAOwwHHb6hkAAABDklEQVR42oWT1wqFMAyG+/4vqDei4sS9t+bwByrV02KhWDO+jKaCDOu6rseu65rSNKV93//06hImmPo9z5PCMCTP82gYBq2NEagzrKqKuq6jvu/5vCyL0VZ8wcqyZACynOeZZUVR0LquWh/xBZOQbdtomqa7BSaoUH9UGBwkDAuXIYHSXoUiCAN1jVVhUncch7Z3KpRLVm+ybVvKsuwBk3rcLpzfcgmVvb6BiGLbNkVRpHVKkoSCINAGw+1blsXQu2SMg+/7lOf5owQs9A5DDSgG/N0itANyzhDpuq57A6FAJtiYPcdxGAY5gGgL7KHTDjbSRJnjOPJrgAOC4IxS8Drg3DQNxXHM4yN1uif6AzeyqbTruz2nAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;N-Array Tree&quot;
        title=&quot;N-Array Tree&quot;
        src=&quot;/static/18f3b27a2ed9e8343256b3acfbf326d0/08115/narytree.png&quot;
        srcset=&quot;/static/18f3b27a2ed9e8343256b3acfbf326d0/c26ae/narytree.png 158w,
/static/18f3b27a2ed9e8343256b3acfbf326d0/6bdcf/narytree.png 315w,
/static/18f3b27a2ed9e8343256b3acfbf326d0/08115/narytree.png 504w&quot;
        sizes=&quot;(max-width: 504px) 100vw, 504px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Binary tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A binary tree is a tree data structure in which each node has at most two children. Binary trees are commonly used to implement search algorithms, such as binary search.
&lt;a href=&quot;/data-structure-js-tree-4/binary-tree&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/988ffc8a1eb5a981e34f57bebe1e1f08/c1b63/binary_tree.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 106.32911392405065%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAAAsTAAALEwEAmpwYAAABLUlEQVR42rWUAU+DMBSEvzLo1A1kAk42cYr//z+aJtfk2SAQxUsISft6vd69FpaRA0dgxwYIJFegA56B7K+EBXABvAiLLQg/pXDcgvAFuDNeXn5DEhbWwABUydwBeNf46pDC8RqpOyZzgeisr1lDlonwASilNMDp3+gLhO0SWVx0lbpR6aY1Uf2wRuG92dlLyU8o51Tu5M+bURrwZPpwCo1IH21LOfnWafE+Ge+T8bQjRpH28SblugWldqxMU3dS2U4kbm2ptWlh+6uf8KSVDR8z93hQkIeplklx1gkq+UTicaYatybxUse11zBPampj0SxpKLzJw4hX2VIZO0LNaUmZl8HR19yMdVJ6MkG2M231zZfYCs48tL2IvAmxW/tS14lnXsHE8PaqcfwnvgDgEAqk5GC3nAAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Binary Tree&quot;
        title=&quot;Binary Tree&quot;
        src=&quot;/static/988ffc8a1eb5a981e34f57bebe1e1f08/f058b/binary_tree.png&quot;
        srcset=&quot;/static/988ffc8a1eb5a981e34f57bebe1e1f08/c26ae/binary_tree.png 158w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/6bdcf/binary_tree.png 315w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/f058b/binary_tree.png 630w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/40601/binary_tree.png 945w,
/static/988ffc8a1eb5a981e34f57bebe1e1f08/c1b63/binary_tree.png 1200w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Binary search tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A binary search tree is a binary tree in which the value of each node is greater than the values of its left children and less than the values of its right children. Binary search trees are used to efficiently search for specific values within a dataset.
&lt;a href=&quot;/data-structure-js-tree-4/binary-search-tree&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 600px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/54e23044d5ab7d9072ece7afa36491b4/e88ff/binary_search_tree.webp&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 58.22784810126582%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/webp;base64,UklGRj4AAABXRUJQVlA4IDIAAAAwAwCdASoUAAwAPtFUo0uoJKMhsAgBABoJaQAAetHPbGUAAP7yDjcEAiA6UgziAAAAAA==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Binary Search Tree&quot;
        title=&quot;Binary Search Tree&quot;
        src=&quot;/static/54e23044d5ab7d9072ece7afa36491b4/e88ff/binary_search_tree.webp&quot;
        srcset=&quot;/static/54e23044d5ab7d9072ece7afa36491b4/81b7c/binary_search_tree.webp 158w,
/static/54e23044d5ab7d9072ece7afa36491b4/6ea66/binary_search_tree.webp 315w,
/static/54e23044d5ab7d9072ece7afa36491b4/e88ff/binary_search_tree.webp 600w&quot;
        sizes=&quot;(max-width: 600px) 100vw, 600px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Balanced tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A balanced tree is a tree data structure in which the heights of the left and right subtrees of each node differ by at most 1. Balanced trees are used to maintain efficient search and insertion/deletion operations.
&lt;a href=&quot;https://www.geeksforgeeks.org/balanced-binary-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/8bd660523496608d826ae4b5b8f180e4/d00b9/balanced_tree.webp&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 75.31645569620254%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/webp;base64,UklGRlYAAABXRUJQVlA4IEoAAABwAwCdASoUAA8APtFUo0uoJKMhsAgBABoJaVefADc12dtLOAAA/vF8/T8NsUXxg1c4NndOI5VoVmDGLZtzzmTKeYwKymyjoqAAAA==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Balanced Tree&quot;
        title=&quot;Balanced Tree&quot;
        src=&quot;/static/8bd660523496608d826ae4b5b8f180e4/8aab1/balanced_tree.webp&quot;
        srcset=&quot;/static/8bd660523496608d826ae4b5b8f180e4/81b7c/balanced_tree.webp 158w,
/static/8bd660523496608d826ae4b5b8f180e4/6ea66/balanced_tree.webp 315w,
/static/8bd660523496608d826ae4b5b8f180e4/8aab1/balanced_tree.webp 630w,
/static/8bd660523496608d826ae4b5b8f180e4/d00b9/balanced_tree.webp 800w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Heap:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A heap is a tree data structure that satisfies the heap property, which states that the value of each node is greater than or equal to the values of its children (in a max-heap) or less than or equal to the values of its children (in a min-heap). Heaps are used to implement efficient priority queues and sorting algorithms.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A max-heap&lt;/strong&gt; is a complete binary tree in which the value of each node is greater than or equal to the values of its children. The root node of a max-heap is the maximum element in the heap.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A min-heap&lt;/strong&gt; is a complete binary tree in which the value of each node is less than or equal to the values of its children. The root node of a min-heap is the minimum element in the heap.
&lt;a href=&quot;/data-structure-js-tree-4/heap-tree&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/e4b14592e104a4f6e44ebae2df7dc636/a8c87/min_max_heap.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 51.89873417721519%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC40lEQVR42jWRWUxTQRiFzy2bMfoAmpRKohgikQdQXACrwV1UECgQNVBqq5Ut1BYK1a5QSlsFSjdjbymFivYiAoJakFVFFJdIjDEmqA8ajSbGmPhm9OWae2MnmYdz5vvPzPw/AKChzwthsxpnbWbknBFFis2G+IPisghGl+pVUN/ohcLphJEMokprwZXbc0wZNI5ursJkX9Y1vgCdqxe+8QUgX1aJExolut8vEpV2KxqveTNbJ275ZaRjc7lRg475CULUqkOm4AgbcvfNV6K2qR16d4AbmFn0ee7MFfknn4OmaSitbqBYKYPYbMD/RRw4VbpOPRA4vKMwNwEAhwElF5uRvHcbCzCa4VZzebHu4dmceosrBUAE4zGvDAMwjARPqoI+BRNinhxBRm5OzHnKr9TcDAiGfn2B98ECpyv0BOTd+Wzf+IJeburkee48YuvdwzPC3umXNduz90ezYbP0HygDnhLVdZ+UAVL4GSyoCnZXqwd6CwZ/fsLYx++cwMxLGD3BLG/ocWNyavrKfKEUH2gaNmqssGfyRVXihpRINlDuc+VJ201p5S2aJLnPVSQy6WIV/svFjLZM38bQu4/ExNIP2IKhLEvP4EGhTLWqs3/shMbhj3cNTu8zkkH+/Le/EMnVQOaxIzFNo9Ql7WBfWcNVsqB14labxNqcbro3ZL/Q33P0+tcl/KZptpc9Uy+qrz18rTWSwayBp+/cLSTFpx6/bey7/0rGnP+maQKGUQontQ1xRfW1y7OPC6LyaqTxTINLGs9xD50WRhfKqyHVGdHipVCjs66oMztjmV+J63VrmGGI67Rxp5X6lXVmJ2TGDsD2ZAoVnRbk11aEJ80lCCIRAI8vyENZ0wWMvP8M19A01HYfbFQozDEXr/2/o8ImHM9mccqsh8TahMNSEdL27OIQBMHhJa2PrHJcZH2JxoC2vlGc7yChavewdVt27uFERcdwEhKTItL5u4mNm7YiOTUd/wAI+C8ggoLPLgAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Min Max Heap&quot;
        title=&quot;Min Max Heap&quot;
        src=&quot;/static/e4b14592e104a4f6e44ebae2df7dc636/f058b/min_max_heap.png&quot;
        srcset=&quot;/static/e4b14592e104a4f6e44ebae2df7dc636/c26ae/min_max_heap.png 158w,
/static/e4b14592e104a4f6e44ebae2df7dc636/6bdcf/min_max_heap.png 315w,
/static/e4b14592e104a4f6e44ebae2df7dc636/f058b/min_max_heap.png 630w,
/static/e4b14592e104a4f6e44ebae2df7dc636/40601/min_max_heap.png 945w,
/static/e4b14592e104a4f6e44ebae2df7dc636/78612/min_max_heap.png 1260w,
/static/e4b14592e104a4f6e44ebae2df7dc636/a8c87/min_max_heap.png 1538w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Trie:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A trie (also known as a prefix tree) is a tree data structure used to store a dynamic set or associative array where the keys are sequences (usually strings). Tries are used for efficient prefix-based search, such as for spelling correction or for efficient data retrieval in databases.
&lt;a href=&quot;https://www.geeksforgeeks.org/introduction-to-trie-data-structure-and-algorithm-tutorials/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/19b617e0cd5c906fcd005a0420ad7173/712de/trie.webp&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 93.67088607594937%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/webp;base64,UklGRgwCAABXRUJQVlA4WAoAAAAQAAAAEwAAEgAAQUxQSPMAAAABgGNt2zHnHtv2TGzbNju1TpuSi8jJIpwqe3CWYZbO6McWIkJt2zYMPabegTgzs8inO5nslVfz9VUrx+Fx1lc6TS5pJieFNpwmCa7zi1aw2qH1/MItNJlMTsPqmvADUfXk1ExvMtmHaf/ULJAThoJQyednKRTGIwGgddQEppHWcEmHBYfZMtRK4/9/E4I5fVCJ8IMGsWYAENR6htHq3WOdbqMWgNlOsBiw5anq1eqQCfDkRT0AU4fjRJzMH3ZTshAAgLvkWfzlJXGTvDV8JDeE9r6XR5LJsa2fHd1jch1hqlBt7ariZRCZyxfxAkVKWxDQ2QAAVlA4IPIAAABQBQCdASoUABMAPtFgqU+oJSOiKAgBABoJZwAEQq8X5Bvd9Av2Fa7FOD9WtsE2t/CTNYAA/svSNAUUOq0aX98B3+g6WI+W4frw6R9ttq2V/rAJt/wts6vFJ6jBYV74KLp/wIo4QcWhVA3b37i+5lMquULoy1PPkb8O2S9L4yjmFVx2jWX+X8EMl493yJtZy0f9Oplnx22Pa8zzdt2wuKm5i6q9/8n/6vE+s5q/l46mKgvNOnfpLkxG+5sKc7zv6iHcuD/jsO97L9J22IW/oEc8YvJB0XwBAopUS+GwFG5sBOQOezk/AkddH0vW5EqGPkAAAA==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Trie Data Structure&quot;
        title=&quot;Trie Data Structure&quot;
        src=&quot;/static/19b617e0cd5c906fcd005a0420ad7173/8aab1/trie.webp&quot;
        srcset=&quot;/static/19b617e0cd5c906fcd005a0420ad7173/81b7c/trie.webp 158w,
/static/19b617e0cd5c906fcd005a0420ad7173/6ea66/trie.webp 315w,
/static/19b617e0cd5c906fcd005a0420ad7173/8aab1/trie.webp 630w,
/static/19b617e0cd5c906fcd005a0420ad7173/712de/trie.webp 828w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Splay tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A splay tree is a self-balancing binary search tree that rearranges itself after each search operation to bring the searched-for item closer to the root. Splay trees are used to implement efficient data structures for dynamic sets and associative arrays.
&lt;a href=&quot;https://www.codesdope.com/course/data-structures-splay-trees/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/7993583471aae40cf17073b005a430fa/0b9e0/splay_tree.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 36.708860759493675%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAHABQDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAG8AD//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAEFAn//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAY/An//xAAYEAADAQEAAAAAAAAAAAAAAAAAARFBUf/aAAgBAQABPyGMk0j6f//aAAwDAQACAAMAAAAQAA//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAaEAACAwEBAAAAAAAAAAAAAAABEQAhMVGB/9oACAEBAAE/EBo7hKgIvpisXyf/2Q==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Splay Tree&quot;
        title=&quot;Splay Tree&quot;
        src=&quot;/static/7993583471aae40cf17073b005a430fa/828fb/splay_tree.jpg&quot;
        srcset=&quot;/static/7993583471aae40cf17073b005a430fa/ff44c/splay_tree.jpg 158w,
/static/7993583471aae40cf17073b005a430fa/a6688/splay_tree.jpg 315w,
/static/7993583471aae40cf17073b005a430fa/828fb/splay_tree.jpg 630w,
/static/7993583471aae40cf17073b005a430fa/0b9e0/splay_tree.jpg 864w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Red-black tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A red-black tree is a self-balancing binary search tree that maintains a specific coloring scheme (red and black) in order to balance the tree. Red-black trees are used to implement efficient data structures for dynamic sets and associative arrays.
&lt;a href=&quot;https://www.geeksforgeeks.org/introduction-to-red-black-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/1cfab1acc903f96ea57199f3a8a022c1/0b533/red-black-tree.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 80.37974683544303%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAAAsTAAALEwEAmpwYAAACu0lEQVR42pWTzWsUSRiHn6qerumq7p7MZ89kJjETk/gVDUHU1cMihIU1Zi56FkFwWcHbsuxhD1EUUdSoo/iBX+sY4gox7kHwIP4BXjx7EhS8ePUfKKmZtLowuNkXuhvefuupen/vr6BP3NKaC0HANa1pVqtieGiIOI4PGGN+4//G/SiiU6mwNDAgBq3FWsvF8+dJkuRtuVy2wLCry+VyvvtKKclkMv8NfJrPd2G21cIXogL8CLSklPXx8XEajUa33vO87wNvGCMfxjEPouinTq32bj6bPWSnp7/8dzDf93+PougvIHYndNB+IdyzHIbyTBiyEIZHOsPD9p4xh9taM5fNqnw+709NTRFF0YvR0VHX/ka38OcgyFwOQ+5GUR9sLufersWBo9AEii6xb88eisViWrUV2AEkT4zhulIsBIG4HQT/QtWBhpTSwfIu8UdPoxJQbc3NpXWbCtlsr0chcvNKHXzg+xseK8Udpb7AAq31hyiK3gOmm4BU6b1hGFpnmSRJEEKM7vI89Rq4CSN/T0zYR2Njr57NzrI8MyNToOf7/pJS6t4Pu3czNjvLRilTpbcbYz4FWh93ctjJSbFsDKeBkxBcLRavnC2Vfvmn2eRZsyncjs5LBWcpwJeeN4AQfAxDTvR8kVuVoGvCNjDdG6BruWDn53stSllWopd2mjXTo0qYAPRrrcNTMFOQcrD7I44zh2DXbdj2K6AgFtCw7Xa6dCQdYA0opdmCEEOO24njc4sjI/auUvsXoWvyTr3+ZnHdOvsSYny/pqDxzVAdI+lryGNas2BM63q1+vys74+fBC7t3MmNUunPdqVyfzuo2lrv8nopqXqem3DBrqy4VBkpQWt3d2N3UqRM6HlOrJVbH5RSr9rHDawkYHCDUsGqzuXUq2uJLDCpvu7u7tNmYIvszqIbTvyxfqs/A2uUdt2Nq/8xAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Red Black Tree&quot;
        title=&quot;Red Black Tree&quot;
        src=&quot;/static/1cfab1acc903f96ea57199f3a8a022c1/0b533/red-black-tree.png&quot;
        srcset=&quot;/static/1cfab1acc903f96ea57199f3a8a022c1/c26ae/red-black-tree.png 158w,
/static/1cfab1acc903f96ea57199f3a8a022c1/6bdcf/red-black-tree.png 315w,
/static/1cfab1acc903f96ea57199f3a8a022c1/0b533/red-black-tree.png 500w&quot;
        sizes=&quot;(max-width: 500px) 100vw, 500px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AVL tree:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;An AVL tree is a self-balancing binary search tree that maintains balance by enforcing a height difference constraint between the left and right subtrees of each node. AVL trees are used to implement efficient data structures for dynamic sets and associative arrays.
&lt;a href=&quot;https://www.enjoyalgorithms.com/blog/avl-tree-data-structure&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Read More…&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 407px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/505e7115b732c5e0f59d8983ad24f101/0ff56/avl_tree.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 74.68354430379746%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAABJ0AAASdAHeZh94AAABg0lEQVR42n1Ui46CMBDk/79N5XKaqKcYH/ECgvJSaUthLltoLdDcJgTanW5ndlq8tm0xedC9Keq6Vg/FB6MGBmOHZ776XDsCBvs9/K8Fmn7OzjsL/gd4Pp+43xMkSYKiKNA0zWd/RzHD0C4qhECapqoAY8wApZTI8xyPxwNCcKcaw9DeMctSrDdrlGVp5jUzYrzw5wijcLBG933AUAexIImanc2CChJDwoyl67dnS82yDJx3cki2dpfi/X6rvHY+iiJwISZFjcvH4xHb7dYkNps1gsOh34xjuVwiOARqzBmD7y9M3lZhGL5eL9U3PQ7D0EiTda3GJJeCekp4YlxVlTl1huHYKXKU+qVzZVGqOSpiO09BJGhuwtC+GbfbDZx3C0+nE75Xq+44ZSlm8xnyojAFGauU84RzFozjWAHIBO16nMTdd5Hj+nsdmEXMiUDZK/LG9hMTkmvfCvtg2/hxqwYuu3qpx1LW2O1+cD5fJjj7p+JkOP7zdK5KdTvobLqK2AX/AOLKltPexTFzAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;AVL Tree&quot;
        title=&quot;AVL Tree&quot;
        src=&quot;/static/505e7115b732c5e0f59d8983ad24f101/0ff56/avl_tree.png&quot;
        srcset=&quot;/static/505e7115b732c5e0f59d8983ad24f101/c26ae/avl_tree.png 158w,
/static/505e7115b732c5e0f59d8983ad24f101/6bdcf/avl_tree.png 315w,
/static/505e7115b732c5e0f59d8983ad24f101/0ff56/avl_tree.png 407w&quot;
        sizes=&quot;(max-width: 407px) 100vw, 407px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h4&gt;Binary Search Tree Implementation using JavaScript&lt;/h4&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;TreeNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinarySearchTree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;TreeNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lookup&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Empty Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Not Found&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Empty Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmostParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmostParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmostParent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;              &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftmost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;BinarySearchTree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;170&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lookup&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;TreeNode {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  left: TreeNode { left: null, right: null, value: 15 },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  right: TreeNode { left: null, right: null, value: 170 },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  value: 20&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;lookup&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Not Found&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; * {&amp;quot;value&amp;quot;:9,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; *  &amp;quot;left&amp;quot;:{&amp;quot;value&amp;quot;:4,&amp;quot;left&amp;quot;:{&amp;quot;value&amp;quot;:1,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null}, &amp;quot;right&amp;quot;:{&amp;quot;value&amp;quot;:6,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null}},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; *  &amp;quot;right&amp;quot;:{&amp;quot;value&amp;quot;:20,&amp;quot;left&amp;quot;:{&amp;quot;value&amp;quot;:15,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null},&amp;quot;right&amp;quot;:{&amp;quot;value&amp;quot;:170,&amp;quot;left&amp;quot;:null,&amp;quot;right&amp;quot;:null}}}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//     9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//  4     20&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//1  6  15  170&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tree&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;depth&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;helper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxDepth&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;Trees are a common data structure used in computer science to represent hierarchical relationships between objects.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h5&gt;Some common applications of tree data structures include:&lt;/h5&gt;
&lt;h6&gt;Hierarchical data representation:&lt;/h6&gt;
&lt;p&gt;Tree data structures are often used to represent the hierarchical data structures, such as the hierarchy of files and directories in a file system or organizational structures. Each directory is represented as a node in the tree, with the files in that directory being the child nodes of the directory node.&lt;/p&gt;
&lt;h6&gt;Decision making:&lt;/h6&gt;
&lt;p&gt;Trees can be used to represent decision-making processes, such as in the game of chess where each move is represented as a node in the tree and the possible subsequent moves are the child nodes. The tree can be searched to find the best move based on a set of predetermined criteria.&lt;/p&gt;
&lt;h6&gt;Web navigation:&lt;/h6&gt;
&lt;p&gt;Trees can be used to represent the structure of a website, with the home page being the root node and the child nodes representing the pages linked from the home page. This can help with navigation and search functionality on a website.&lt;/p&gt;
&lt;h6&gt;Searching and sorting:&lt;/h6&gt;
&lt;p&gt;Trees can be used to implement efficient search and sorting algorithms, such as binary search trees and red-black trees to filter large amount or to find related keywords and results in a search engine.&lt;/p&gt;
&lt;h6&gt;Network routing:&lt;/h6&gt;
&lt;p&gt;Trees can be used to represent the topology of a network or network routing algorithms, with the nodes representing devices and the edges representing connections between the devices. This can help with routing data packets through the network.&lt;/p&gt;
&lt;h6&gt;Parsing:&lt;/h6&gt;
&lt;p&gt;Trees can be used to represent the structure of a mathematical expression, with the nodes representing the operators and the leaves representing the operands. This can be used to evaluate the expression or to simplify it. Other then this Trees are often used in natural language processing and computer science to represent the structure of a sentence or program.&lt;/p&gt;
&lt;h4&gt;Here are some tree data structure problems from LeetCode&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/maximum-depth-of-binary-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Maximum Depth of Binary Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/validate-binary-search-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Validate Binary Search Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/binary-tree-inorder-traversal/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Binary Tree Inorder Traversal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/symmetric-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Symmetric Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Convert Sorted Array to Binary Search Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/invert-binary-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Invert Binary Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/flatten-binary-tree-to-linked-list/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Flatten Binary Tree to Linked List&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/binary-tree-maximum-path-sum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Binary Tree Maximum Path Sum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/populating-next-right-pointers-in-each-node/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Populating Next Right Pointers in Each Node&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Construct Binary Tree from Preorder and Inorder Traversal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Lowest Common Ancestor of a Binary Tree&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://leetcode.com/problems/binary-tree-level-order-traversal/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Binary Tree Level Order Traversal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Data Structure and Algorithms with JS - Part 3 : Stack and Queue]]></title><description><![CDATA[An array is a data structure that stores a collection of elements in a contiguous block of memory. It allows us to store and access data efficiently, as elements can be accessed using their index, which is their position in the array.]]></description><link>https://codeentity.tech/data-structure-js-stack-queue-3/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-js-stack-queue-3/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Array]]></category><category><![CDATA[Stack]]></category><category><![CDATA[Queue]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Mon, 28 Mar 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/1f34227760500fa88344164f2359c911/3fe84/stackandqueue.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 41.77215189873418%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAIABQDASIAAhEBAxEB/8QAFwABAAMAAAAAAAAAAAAAAAAAAAECBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHdgSwX/8QAFxAAAwEAAAAAAAAAAAAAAAAAARARIf/aAAgBAQABBQLaav/EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABYQAAMAAAAAAAAAAAAAAAAAAAAQMf/aAAgBAQAGPwIq/8QAGRAAAwEBAQAAAAAAAAAAAAAAABEhAWGh/9oACAEBAAE/Ia4EXPDMap//2gAMAwEAAgADAAAAEH/P/8QAFREBAQAAAAAAAAAAAAAAAAAAERD/2gAIAQMBAT8QGf/EABURAQEAAAAAAAAAAAAAAAAAABAR/9oACAECAQE/EKf/xAAcEAEAAgIDAQAAAAAAAAAAAAABEUEAMSFRkcH/2gAIAQEAAT8QmJAW2Ne3hbhC6fll6T2Xn//Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;stack and queue&quot;
        title=&quot;stack and queue&quot;
        src=&quot;/static/1f34227760500fa88344164f2359c911/828fb/stackandqueue.jpg&quot;
        srcset=&quot;/static/1f34227760500fa88344164f2359c911/ff44c/stackandqueue.jpg 158w,
/static/1f34227760500fa88344164f2359c911/a6688/stackandqueue.jpg 315w,
/static/1f34227760500fa88344164f2359c911/828fb/stackandqueue.jpg 630w,
/static/1f34227760500fa88344164f2359c911/0ede0/stackandqueue.jpg 945w,
/static/1f34227760500fa88344164f2359c911/3ac88/stackandqueue.jpg 1260w,
/static/1f34227760500fa88344164f2359c911/3fe84/stackandqueue.jpg 1599w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h4&gt;Stack&lt;/h4&gt;
&lt;p&gt;A stack is a linear data structure that follows the Last In First Out (LIFO) principle. This means that the last element added to the stack will be the first one to be removed.&lt;/p&gt;
&lt;p&gt;Stacks are commonly used to store data temporarily while a program is executing. They can be used to implement function calls, as well as to reverse the order of items.&lt;/p&gt;
&lt;p&gt;Operations that are typically supported by stacks include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;push&lt;/code&gt;: adds an element to the top of the stack&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pop&lt;/code&gt;: removes the element at the top of the stack and returns it&lt;/li&gt;
&lt;li&gt;&lt;code&gt;peek&lt;/code&gt;: returns the element at the top of the stack without removing it&lt;/li&gt;
&lt;li&gt;&lt;code&gt;isEmpty&lt;/code&gt;: returns true if the stack is empty, false otherwise&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Here is an Example of a Stack implementation using LinkedList in Javascript&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;StackNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Stack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;peek&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;StackNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Stack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; Stack {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  top: StackNode { value: &amp;#39;google&amp;#39;, next: null },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  bottom: StackNode { value: &amp;#39;google&amp;#39;, next: null },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  length: 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;udemy&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; Stack {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  top: StackNode {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;    value: &amp;#39;udemy&amp;#39;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;    next: StackNode { value: &amp;#39;google&amp;#39;, next: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  bottom: StackNode { value: &amp;#39;google&amp;#39;, next: null },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  length: 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;discord&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; Stack {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  top: StackNode {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;    value: &amp;#39;discord&amp;#39;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;    next: StackNode { value: &amp;#39;udemy&amp;#39;, next: [StackNode] }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  bottom: StackNode { value: &amp;#39;google&amp;#39;, next: null },&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;  length: 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//discord&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//udemy&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;peek&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//google&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myStack&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;We can implement stack using array and linked list both.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Array-based stack:&lt;/strong&gt;
This type of stack is implemented using an array, where the elements are stored in contiguous memory locations. The array can be resized as needed to accommodate new elements. Insertion and deletion operations are typically O(1) time complexity.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Linked list-based stack:&lt;/strong&gt;
This type of stack is implemented using a linked list, where each node in the list contains a value and a pointer to the next node in the list. Insertion and deletion operations are typically O(1) time complexity.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stacks are widely used in computer science and have many practical applications. Some common uses of stacks include:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Evaluating mathematical expressions:&lt;/strong&gt; Stacks are often used to evaluate mathematical expressions, such as infix, prefix, and postfix notation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Compiler design:&lt;/strong&gt; Stacks are used in compiler design for tasks such as syntax parsing, symbol table management, and code generation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Function calls:&lt;/strong&gt; Stacks are used to store information about function calls in a program, including the return address and the values of local variables. &lt;strong&gt;Javascript call stack&lt;/strong&gt; and an error we encounter in infinite loop &lt;strong&gt;stack overflow&lt;/strong&gt;. 😝😝&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Undo/redo functionality:&lt;/strong&gt; Stacks can be used to implement undo/redo functionality in text editors, image editors, and other software applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Backtracking:&lt;/strong&gt; Stacks can be used to store the state of a problem as it is being solved, allowing the algorithm to backtrack and try alternative solutions if necessary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Maze solving:&lt;/strong&gt; Stacks can be used to store the path taken during a maze-solving algorithm, allowing the algorithm to backtrack and try alternative paths if necessary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Topological sorting:&lt;/strong&gt; Stacks can be used to implement topological sorting algorithms, which are used to order the vertices of a directed acyclic graph.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Memory management:&lt;/strong&gt; Stacks are used in memory management to keep track of the memory used by a program and to allocate and deallocate memory as needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DFS (depth-first search):&lt;/strong&gt; Stacks are used to implement DFS algorithms, which traverse the graph or tree vertically.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are some Leetcode problems that involve stacks:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/valid-parentheses/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Valid Parentheses&lt;/a&gt;: Given a string containing just the characters ’(’, ’)’, ’{’, ’}’, ’[’ and ’]’, determine if the input string is valid.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/evaluate-reverse-polish-notation/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Evaluate Reverse Polish Notation&lt;/a&gt;: Evaluate the value of an arithmetic expression in Reverse Polish Notation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/basic-calculator/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Basic Calculator&lt;/a&gt;: Implement a basic calculator to evaluate a simple expression string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/decode-string/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt; Decode String&lt;/a&gt;: Given an encoded string, return its decoded string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/min-stack/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Min Stack&lt;/a&gt;: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/maximal-rectangle/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Maximal Rectangle&lt;/a&gt;: Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/trapping-rain-water/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Trapping Rain Water&lt;/a&gt;: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/evaluate-division/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Evaluate Division&lt;/a&gt;: Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/remove-duplicate-letters/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Remove Duplicate Letters&lt;/a&gt;: Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Queue&lt;/h4&gt;
&lt;p&gt;A queue is a linear data structure that follows the first-in, first-out (FIFO) principle. This means that the first element added to the queue will be the first one to be removed. Queues are often used to store data that needs to be processed in a specific order, and they support a limited set of operations, such as inserting an element at the back of the queue (also known as enqueuing), removing an element from the front of the queue (also known as dequeuing), and checking the element at the front of the queue.&lt;/p&gt;
&lt;p&gt;Queues can be implemented using an array or a linked list. Array-based queues have a fixed size and may need to be resized if the number of elements exceeds the capacity of the array. Linked list-based queues can grow and shrink dynamically as elements are added and removed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an Example of a Queue implementation using LinkedList in Javascript&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;QueueNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Queue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;peek&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;enqueue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;QueueNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dequeue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Queue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;enqueue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Joy&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//QueueNode { value: &amp;#39;Joy&amp;#39;, next: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;enqueue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Matt&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//QueueNode { value: &amp;#39;Matt&amp;#39;, next: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;enqueue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Pav&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//QueueNode { value: &amp;#39;Pav&amp;#39;, next: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dequeue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Joy&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;enqueue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Sam&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//QueueNode { value: &amp;#39;Sam&amp;#39;, next: null }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dequeue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Matt&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;myQ&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dequeue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Pav&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;There are several types of queue data structures, each with its own characteristics and use cases:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Standard queue:&lt;/strong&gt;
A standard queue is a basic queue data structure that supports the operations of enqueuing and dequeuing elements. It can be implemented using an array or a linked list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Circular queue:&lt;/strong&gt;
A circular queue is a queue data structure that uses a fixed-size array and wraps around when the end of the array is reached. It allows for efficient insertion and deletion operations, but requires careful handling to avoid overwriting elements that have not yet been dequeued.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Priority queue:&lt;/strong&gt;
A priority queue is a queue data structure where each element has a priority associated with it. Elements are dequeued in order of their priority, with the highest priority element being dequeued first. Priority queues can be implemented using an array, a linked list, or a heap data structure.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Double-ended queue (deque):&lt;/strong&gt;
A double-ended queue (deque) is a queue data structure that allows for efficient insertion and deletion at both ends of the queue. It can be implemented using an array or a linked list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Blocking queue:&lt;/strong&gt;
A blocking queue is a queue data structure that blocks enqueuing operations if the queue is full and dequeuing operations if the queue is empty. This can be used to synchronize multiple threads or processes that are accessing the queue.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Concurrent queue:&lt;/strong&gt;
A concurrent queue is a queue data structure that is designed to be thread-safe, allowing multiple threads to enqueue and dequeue elements concurrently without the need for explicit synchronization.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some common uses of queues include:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Task scheduling:&lt;/strong&gt; Queues can be used to store tasks that need to be processed in a specific order, such as jobs in a printer queue or tasks in a CPU scheduling algorithm.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Communication buffers:&lt;/strong&gt; Queues can be used to store data that needs to be transmitted between two systems, such as packets in a network communication protocol.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;BFS (breadth-first search):&lt;/strong&gt; Queues are used to implement BFS algorithms, which traverse the graph or tree horizontally (level by level)..&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Event-driven programming:&lt;/strong&gt; Queues can be used to store events that need to be processed in a specific order, such as user input events in a graphical user interface (GUI).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Asynchronous programming:&lt;/strong&gt; Queues can be used to store tasks that need to be executed asynchronously, such as in a web server handling multiple requests simultaneously.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are some Leetcode problems that involve queues&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/implement-queue-using-stacks/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Implement Queue using Stacks&lt;/a&gt;: Implement a first-in, first-out (FIFO) queue using only two stacks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/rotate-array/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Rotate Array&lt;/a&gt;: Given an array, rotate the array to the right by k steps, where k is non-negative.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/queue-reconstruction-by-height/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Queue Reconstruction by Height&lt;/a&gt;: Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/find-median-from-data-stream/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Find Median from Data Stream&lt;/a&gt;: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/sliding-window-maximum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Sliding Window Maximum&lt;/a&gt;: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/design-circular-queue/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Design Circular Queue&lt;/a&gt;: Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/number-of-islands/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Number of Islands&lt;/a&gt;: Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/number-of-provinces/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Number of Provinces&lt;/a&gt;: There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c. A province is a group of directly or indirectly connected cities and no other cities outside of the group. Return the total number of provinces.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;In conclusion, we can say that Stacks and Queues are linear data structures that are used to store and manipulate data in a specific order. Stacks follow the last-in, first-out (LIFO) principle, while Queues follow the first-in, first-out (FIFO) principle. Both data structures support a limited set of operations, such as pushing and popping elements in the case of stacks, and enqueuing and dequeuing elements in the case of queues.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Data Structure and Algorithms with JS - Part 2 : Linked List]]></title><description><![CDATA[A linked list is a linear data structure that consists of a sequence of nodes, where each node stores a reference to an object and a reference to the next node in the sequence. The last node in the list typically has a reference to null, indicating the end of the list.]]></description><link>https://codeentity.tech/data-structure-js-linked-list-2/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-js-linked-list-2/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Linked List]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Mon, 07 Mar 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;A linked list&lt;/strong&gt; is a linear data structure that consists of a sequence of nodes. Each node in a linked list stores a reference to an object and a reference to the next node in the sequence. The last node in the list typically has a reference to null, indicating the end of the list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Linked lists have several advantages over arrays.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Insertions and deletions at the beginning of the list are very fast, as they only require updating a single reference. In contrast, inserting or deleting an element at the beginning of an array requires shifting all the elements of the array by one position, which can be time-consuming.&lt;/li&gt;
&lt;li&gt;Linked lists also don’t required consecutive memory space, because they store the data and a reference to the next node, rather than the entire list of elements together.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;However, linked lists have some disadvantages compared to arrays.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;They do not provide constant-time access to individual elements, since you have to start at the beginning of the list and follow the references to find the element you are looking for.&lt;/li&gt;
&lt;li&gt;Linked lists also require more memory per element, because they store both the data and the reference to the next element.&lt;/li&gt;
&lt;li&gt;Because each element within an array only needs to store its value, compared to a linked list where there is also a pointer field along with the data field, an array takes up less memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Linked lists are often used in applications where the list is frequently modified, such as in the implementation of stacks, queues, and hash tables.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h6&gt;Here is an example of a simple linked list implementation in JavaScript:&lt;/h6&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;prepend&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//check params&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;targetNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverseToIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;targetNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;targetNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Invalid Index Value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;targetNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverseToIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;targetNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;targetNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;traverseToIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Method 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// let curr = this.head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// this.head = null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// while(curr){&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//   this.prependNode(curr)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//   curr = curr.next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//method 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;second&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;temp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;first&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;prependNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;node&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;prepend&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;prepend&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sampleList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;There are several types of linked lists that you can implement in JavaScript. Some common types of linked lists include:&lt;/strong&gt;&lt;/p&gt;
&lt;h5&gt;Singly linked list:&lt;/h5&gt;
&lt;p&gt;A singly linked list is a linked list where each node stores a reference to the next node in the list, but not to the previous node. This means that you can only traverse the list in a single direction, starting from the head of the list. The linked list we have implemented above is a singly linked list.
Singly Linked list node:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Doubly linked list:&lt;/h5&gt;
&lt;p&gt;A doubly linked list is a linked list where each node stores a reference to both the next and previous nodes in the list. This allows you to traverse the list in both directions, starting from either the head or the tail of the list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of a doubly linked list implementation in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printForward&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printBackward&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;tail&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prev&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;You can use this doubly linked list implementation by creating a new instance of the &lt;code&gt;LinkedList&lt;/code&gt; class and adding nodes to the list using the add method:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printForward&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints 1 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;printBackward&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints 3 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Circular linked list:&lt;/h5&gt;
&lt;p&gt;A circular linked list is a linked list where the last node in the list points back to the first node, forming a circular loop. This allows you to traverse the list in a loop, starting from any node in the list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of a circular linked list implementation in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;current&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;You can use this circular linked list implementation by creating a new instance of the &lt;code&gt;LinkedList&lt;/code&gt; class and adding nodes to the list using the add method:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;LinkedList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;contains&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Skip list:&lt;/h5&gt;
&lt;p&gt;A skip list is a data structure that combines elements of linked lists and arrays to provide fast search and insertion operations. In a skip list, each node has multiple pointers to other nodes, allowing you to skip over large sections of the list when searching for an element.
It is a linked list with multiple levels, where each level has a certain probability of being skipped during a search. This allows the skip list to have a search time that is logarithmic (&lt;code&gt;O(log(n))&lt;/code&gt;) in the number of elements, similar to a balanced binary search tree.
Skip lists are interesting data structures that rely on a random element in its design.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 622px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/0b8d53efd7c817d8ba436d8462a9a037/604ec/skip_list.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 42.405063291139236%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB90lEQVR42lWRv4saURDH36qcHlyyrjG3chBBEH9Et8+VNtp4AbuzCXitTa5OqiCxdouNfQoxRTbhLsUF8VL4DwRJhHBxV71Gss9d9z1fFmPYMIsBb2B4b2Y+zJvvPGQvly5jbJXLPY4ihAI8z+8jhEL/3efzhRKJxD44x3Gh3VoymQTW12q14pZl/SWE/kKGYfRM0+yWSqXQl+trVKlUOLS1WCzmnXiB0Xw+v5MDk2WZsywL9ft93jCM9xjjt+j5+blQrZ4+AIAPC2jX8vk8cl0XjUajyHA4jMBdkqQ7TDwe9856vS7UarUIskzzN6X05/Hxk3tQyOVygXQ67S8UCgFooLxRRNu2teVyedNut72mxWIxkMlk/OVy2WO63a5omuatbdvfEKWUOI7zQ8rnYTy/KIrBcDi8l0qlgrCfZrN5RCnVCCE3jUbjIeSy2WxQEIQ9SZJgl5yiKEeEkAlj7CsMdQBqQ8GgN/pgMPBkqqq6uzMeuEPx0Mt9vrrymIuLy13ZoPA+fMrAtKwPZ2e1A4B0Xa8RQr6Px+MqxJ1OJ4oxvsQYf1RVVdgyzwghmq7rpxD3er2oYRifFovFO8TYyl2v/yyenpyIUJzNZq/X67WradpLiGVZTjDGyGq1shRFeQS56XT6arPZuJPJ9MX20QSllDmOc/sPKzIWCRUOI5kAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Skip List&quot;
        title=&quot;Skip List&quot;
        src=&quot;/static/0b8d53efd7c817d8ba436d8462a9a037/604ec/skip_list.png&quot;
        srcset=&quot;/static/0b8d53efd7c817d8ba436d8462a9a037/c26ae/skip_list.png 158w,
/static/0b8d53efd7c817d8ba436d8462a9a037/6bdcf/skip_list.png 315w,
/static/0b8d53efd7c817d8ba436d8462a9a037/604ec/skip_list.png 622w&quot;
        sizes=&quot;(max-width: 622px) 100vw, 622px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of a Skip linked list implementation in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;js&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;SkipListNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fill&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;SkipList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;SkipListNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;MAX_LEVEL&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;randomLevel&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;P&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;MAX_LEVEL&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;MAX_LEVEL&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fill&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;randomLevel&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;SkipListNode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;MAX_LEVEL&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fill&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;curr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;level&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;SkipList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints Node with val 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// prints null&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;XOR linked list:&lt;/h5&gt;
&lt;p&gt;An XOR linked list is a data structure that uses a special type of pointer called an “exclusive or” (XOR) pointer to store the reference to the next node in the list. XOR linked lists can be used to implement a doubly linked list using only a single field in each node, rather than two fields (one for the next node and one for the previous node). This can be more memory-efficient, but can also be more complex to implement.
We can not implement a proper XOR linked list in Javascript as we cannot access the memory address. So in js it will be equivalent to a doubly linked list.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 500px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/5ec9f885b39e1c2fea612d474ac6eb9d/41099/xor.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 33.54430379746836%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAHABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAEF/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAAB3AUH/8QAFhAAAwAAAAAAAAAAAAAAAAAAABAh/9oACAEBAAEFAir/xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAY/An//xAAWEAEBAQAAAAAAAAAAAAAAAAABABH/2gAIAQEAAT8hRsht/9oADAMBAAIAAwAAABDzz//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABsQAAIBBQAAAAAAAAAAAAAAAAABESFBYZGh/9oACAEBAAE/EJNOmRCQvs//2Q==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;XOR List&quot;
        title=&quot;XOR List&quot;
        src=&quot;/static/5ec9f885b39e1c2fea612d474ac6eb9d/41099/xor.jpg&quot;
        srcset=&quot;/static/5ec9f885b39e1c2fea612d474ac6eb9d/ff44c/xor.jpg 158w,
/static/5ec9f885b39e1c2fea612d474ac6eb9d/a6688/xor.jpg 315w,
/static/5ec9f885b39e1c2fea612d474ac6eb9d/41099/xor.jpg 500w&quot;
        sizes=&quot;(max-width: 500px) 100vw, 500px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are a few Leetcode problems that involve linked lists:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/reverse-linked-list/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Reverse Linked List&lt;/a&gt;: Reverse a singly linked list.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/merge-two-sorted-lists/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Merge Two Sorted Lists&lt;/a&gt;: Merge two sorted linked lists and return it as a new sorted list.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/add-two-numbers/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Add Two Numbers&lt;/a&gt;: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/linked-list-cycle/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Linked List Cycle&lt;/a&gt;: Given a linked list, determine if it has a cycle in it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/linked-list-cycle-ii/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Linked List Cycle II&lt;/a&gt;: Given a linked list, return the node where the cycle begins. If there is no cycle, return null.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/remove-nth-node-from-end-of-list/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Remove Nth Node From End of List&lt;/a&gt;: Given a linked list, remove the n-th node from the end of list and return its head.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/palindrome-linked-list/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Palindrome Linked List&lt;/a&gt;: Given a singly linked list, determine if it is a palindrome.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Linked List Type&lt;/th&gt;
&lt;th&gt;Insertion Complexity&lt;/th&gt;
&lt;th&gt;Access Complexity&lt;/th&gt;
&lt;th&gt;Pros&lt;/th&gt;
&lt;th&gt;Cons&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Singly Linked List&lt;/td&gt;
&lt;td&gt;O(1)&lt;/td&gt;
&lt;td&gt;O(n)&lt;/td&gt;
&lt;td&gt;Simple to implement.&lt;/td&gt;
&lt;td&gt;Poor performance for certain operations. (e.g. inserting at a specific position.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Doubly Linked List&lt;/td&gt;
&lt;td&gt;O(1)&lt;/td&gt;
&lt;td&gt;O(n)&lt;/td&gt;
&lt;td&gt;Allows for insertion and deletion at both ends of the list.&lt;/td&gt;
&lt;td&gt;Requires more memory due to additional pointers.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Circular Linked List&lt;/td&gt;
&lt;td&gt;O(1)&lt;/td&gt;
&lt;td&gt;O(n)&lt;/td&gt;
&lt;td&gt;Allows for efficient insertion at the end of the list.&lt;/td&gt;
&lt;td&gt;Poor performance for certain operations. (e.g. inserting at a specific position.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Skip List&lt;/td&gt;
&lt;td&gt;O(log n)&lt;/td&gt;
&lt;td&gt;O(log n)&lt;/td&gt;
&lt;td&gt;Allows for efficient search and insertion.&lt;/td&gt;
&lt;td&gt;Requires more memory due to additional pointers.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XOR Linked List&lt;/td&gt;
&lt;td&gt;O(1)&lt;/td&gt;
&lt;td&gt;O(n)&lt;/td&gt;
&lt;td&gt;Uses less memory than doubly linked list.&lt;/td&gt;
&lt;td&gt;Complex to implement and may have poor performance for certain operations.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Data Structure and Algorithms with JS - Part 1 : Arrays]]></title><description><![CDATA[An array is a data structure that stores a collection of elements in a contiguous block of memory. It allows us to store and access data efficiently, as elements can be accessed using their index, which is their position in the array.]]></description><link>https://codeentity.tech/data-structure-with-js-array-1/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-with-js-array-1/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Array]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 25 Feb 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;Arrays are a fundamental data structure in computer science and are used in a wide variety of applications. They are particularly useful for storing and manipulating large datasets, as they allow us to access and manipulate elements quickly using their indices.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There are several advantages to using arrays:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Arrays are efficient for storing and accessing data. Because elements are stored in a contiguous block of memory, we can access them quickly using their indices.&lt;/li&gt;
&lt;li&gt;Arrays are easy to use. They offer a simple interface for storing, accessing, and manipulating data.&lt;/li&gt;
&lt;li&gt;Arrays are flexible. We can store elements of any data type in an array, and we can add or remove elements at any time.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are also some limitations to using arrays:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Arrays have a fixed size. Once we create an array, we cannot change its size unless we create a new array and copy the elements from the old array to the new one.&lt;/li&gt;
&lt;li&gt;Arrays are not always the most efficient data structure for certain operations. For example, inserting or deleting elements from the middle of an array can be time-consuming, as it requires shifting all the elements after the inserted/deleted element.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Despite these limitations, arrays are still a widely used data structure due to their simplicity and efficiency. They are commonly used in a variety of programming languages, including C, C++, Java, and Python, as well as in many other applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In JavaScript&lt;/strong&gt;, arrays are a subclass of the object data type, and they have a &lt;code&gt;length&lt;/code&gt; property that represents the number of elements in the array. &lt;a href=&quot;https://v8.dev/blog/elements-kinds&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;They are dynamic&lt;/a&gt;, which means that we can add or remove elements from the array at any time.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Elements of small enough arrays are stored in an internal fixed-size array. V8 allocates some extra space in the internal array to achieve constant amortized time for push() and similar operations that grow the array. When the array length decreases, the internal array may also shrink.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Once a JS array becomes large (this also includes holey arrays), V8 starts using a hash table to store the array elements. The array is now associated with the “slow” dictionary elements kind.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;From &lt;a href=&quot;https://itnext.io/v8-deep-dives-understanding-array-internals-5b17d7a28ecc&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;[V8 Deep Dives] Understanding Array Internals&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;We can manipulate arrays in various ways. Here are a few examples:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;push&lt;/strong&gt; method adds an element to the end of the array&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;unshift&lt;/strong&gt; method adds an element to the beginning of the array&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pop&lt;/strong&gt; method removes the last element of the array&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;shift&lt;/strong&gt; method removes the first element of the array&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;splice&lt;/strong&gt; method removes or adds elements to the array at a specific index&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Let’s Implement basic Array class in js&lt;/h5&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;MyArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;item&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;lastItem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;lastItem&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;shiftItems&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;shiftItems&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;MyArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Hi&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;fiji&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;you&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//me&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;newarr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//{ length: 3, data: { &amp;#39;0&amp;#39;: &amp;#39;Hi&amp;#39;, &amp;#39;1&amp;#39;: &amp;#39;fiji&amp;#39;, &amp;#39;2&amp;#39;: &amp;#39;me&amp;#39; } }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Algorithms implemented using Arrays&lt;/h4&gt;
&lt;h5&gt;Sorting&lt;/h5&gt;
&lt;p&gt;&lt;a href=&quot;/array-sorting&quot;&gt;Sorting&lt;/a&gt; is a common operation in competitive programming. Sorting an array can make it easier to search for a specific element or to find the minimum or maximum element. There are many different &lt;a href=&quot;https://www.geeksforgeeks.org/sorting-algorithms/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;sorting algorithms&lt;/a&gt; to choose from, including&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Selection Sort&lt;/li&gt;
&lt;li&gt;Bubble Sort&lt;/li&gt;
&lt;li&gt;Insertion Sort&lt;/li&gt;
&lt;li&gt;Merge Sort&lt;/li&gt;
&lt;li&gt;Quick Sort&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Searching&lt;/h5&gt;
&lt;p&gt;&lt;a href=&quot;/array-searching&quot;&gt;Linear search and binary search&lt;/a&gt; are two algorithms that can be used to search for a specific element in an array.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Linear search&lt;/strong&gt; is a simple algorithm that involves iterating through the array element by element and comparing each element to the target element. If the target element is found, the search is complete. If the target element is not found, the search continues until the end of the array is reached. Linear search has a time complexity of &lt;code&gt;O(n)&lt;/code&gt;, where n is the size of the array. This means that the time taken by the algorithm increases linearly with the size of the array.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Binary search&lt;/strong&gt; is a more efficient algorithm that can be used to search for an element in a sorted array. It works by dividing the array in half and comparing the target element to the middle element. If the target element is less than the middle element, the search continues in the left half of the array. If the target element is greater than the middle element, the search continues in the right half of the array. This process is repeated until the target element is found or it is determined that the element is not present in the array. Binary search has a time complexity of&lt;code&gt; O(log n)&lt;/code&gt;, which means that the time taken by the algorithm increases logarithmically with the size of the array.&lt;/p&gt;
&lt;h4&gt;Techniques used to solve problems using Arrays&lt;/h4&gt;
&lt;h5&gt;Prefix sums:&lt;/h5&gt;
&lt;p&gt;Prefix sums are a technique that can be used to quickly find the sum of a range of elements in an array. They work by storing the cumulative sum of the elements in the original array in a new array. For example, if the original array is &lt;code&gt;[1, 2, 3, 4]&lt;/code&gt;, the prefix sum array would be &lt;code&gt;[1, 3, 6, 10]&lt;/code&gt;.
&lt;strong&gt;Here is an example of how you might implement prefix sums in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;prefixSums&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;prefixSums&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: [1, 3, 6, 10]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can then use the prefix sum array to quickly find the sum of a range of elements in the original array. For example, to find the sum of the elements in the range &lt;code&gt;[1, 3]&lt;/code&gt; (i.e., the sum of the second, third, and fourth elements in the array), you can use the following code:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;startIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;endIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;endIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;prefixSumArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;startIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: 9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Prefix sums have a time complexity of O(n) and require O(n) additional space to store the prefix sum array. They are useful for quickly answering queries about ranges of elements in an array, and they can be especially useful in dynamic programming problems where you need to perform repeated queries on the same array.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are a few examples of Leetcode problems where prefix sums can be used to efficiently find the solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/subarray-sum-equals-k/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Subarray Sum Equals K&lt;/a&gt;: Given an array of integers and a target sum, find the number of contiguous subarrays whose sum is equal to the target sum.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/minimum-size-subarray-sum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Minimum Size Subarray Sum&lt;/a&gt;: Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/range-sum-query-mutable/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Range Sum Query - Mutable&lt;/a&gt;: Given an integer array nums, you are allowed to perform the following operations:
sumRange(i, j): Returns the sum of the elements in nums between indices i and j (i ≤ j), inclusive.
update(i, val): Modifies nums by updating the element at index i to val.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Number of Subarrays with Bounded Maximum&lt;/a&gt;: We are given an array A of positive integers, and two positive integers L and R. Return the number of (contiguous, non-empty) subarrays such that the value of the maximum array element in that subarray is at least L and at most R.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/subarray-product-less-than-k/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Subarray Product Less Than K&lt;/a&gt;: Your are given an array of positive integers nums. Count and return the number of (contiguous) subarrays where the product of all the elements in the subarray is less than k.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In all of these problems, prefix sums can be used to efficiently find the sum or product of a range of elements in the array, which can then be used to solve the problem.&lt;/p&gt;
&lt;h5&gt;Two pointer technique:&lt;/h5&gt;
&lt;p&gt;The two pointer technique is a technique that involves using two pointers to iterate through an array and perform some operation on the elements. It is often used to solve problems that involve finding a pair of elements that meet some condition or to find the maximum or minimum of a contiguous subarray.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of how the two pointer technique might be used to find the maximum sum of a contiguous subarray in an array:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;maxSumSubarray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;start&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;maxSumSubarray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: 7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the two pointers &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; are used to mark the start and end of the current contiguous subarray. The &lt;code&gt;currentSum&lt;/code&gt; variable is used to store the sum of the elements in the current subarray. The algorithm iterates through the array, adding each element to the &lt;code&gt;currentSum&lt;/code&gt; and updating the &lt;code&gt;maxSum&lt;/code&gt; and &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; pointers as necessary.&lt;/p&gt;
&lt;p&gt;The two pointer technique can be very useful for solving problems that involve finding pairs of elements or subarrays that meet certain conditions. It is often used in competitive programming and can be an efficient way to solve certain types of problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are a few examples of Leetcode problems where two pointers technique can be used to efficiently find the solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/two-sum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Two Sum&lt;/a&gt;: Given an array of integers, return indices of the two numbers such that they add up to a specific target.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/3sum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;3Sum&lt;/a&gt;: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/container-with-most-water/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Container With Most Water&lt;/a&gt;: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/valid-palindrome/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Valid Palindrome&lt;/a&gt;: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/reverse-string/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Reverse String&lt;/a&gt;: Write a function that reverses a string. The input string is given as an array of characters char[].&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In all of these problems, the two pointer technique can be used to efficiently iterate through the array and perform some operation on the elements, such as comparing them to a target value or checking for palindromicity.&lt;/p&gt;
&lt;h5&gt;Sliding window:&lt;/h5&gt;
&lt;p&gt;The sliding window technique is a technique that involves maintaining a window of elements in an array and sliding it along the array to perform some operation on the elements in the window. It is often used to solve problems that involve finding the maximum or minimum of a contiguous subarray or finding the number of elements that meet some condition.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of how the sliding window technique might be used to find the maximum sum of a contiguous subarray of size k in an array:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;maxSumSubarray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;maxSumSubarray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;maxSum&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: 7&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the sliding window is represented by the currentSum variable, which stores the sum of the elements in the current window. The algorithm iterates through the array, adding each element to the currentSum and subtracting the element that is being removed from the window. The maxSum variable is used to store the maximum sum of all the windows.&lt;/p&gt;
&lt;p&gt;The sliding window technique can be very useful for solving problems that involve finding the maximum or minimum of a contiguous subarray or the number of elements that meet a certain condition. It is often used in competitive programming and can be an efficient way to solve certain types of problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are a few examples of Leetcode problems where the sliding window technique can be used to efficiently find the solution&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/minimum-window-substring/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Minimum Window Substring&lt;/a&gt;: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/longest-substring-without-repeating-characters/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Longest Substring Without Repeating Characters&lt;/a&gt;: Given a string, find the length of the longest substring without repeating characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/find-all-anagrams-in-a-string/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Find All Anagrams in a String&lt;/a&gt;: Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Longest Substring with At Most Two Distinct Characters&lt;/a&gt;: Given a string s , find the length of the longest substring t that contains at most 2 distinct characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/sliding-window-maximum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Sliding Window Maximum&lt;/a&gt;: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In all of these problems, the sliding window technique can be used to efficiently iterate through the array or string and perform some operation on the elements in the window.&lt;/p&gt;
&lt;h5&gt;2D Array:&lt;/h5&gt;
&lt;p&gt;The 2D array technique is a technique for working with two-dimensional arrays, which are arrays that have rows and columns. 2D arrays are commonly used to store and manipulate data in a variety of contexts, such as image processing, data analysis, and competitive programming.&lt;/p&gt;
&lt;p&gt;There are many algorithms and techniques that can be used to work with 2D arrays, including looping through the elements of the array, rotating the array, finding the maximum or minimum of a submatrix, and using prefix sums to find the sum of a range of elements.&lt;/p&gt;
&lt;p&gt;To use the 2D array technique effectively, it is important to have a good understanding of how 2D arrays work and how to manipulate them. This may involve understanding how to access and modify elements of the array, how to iterate through the elements of the array, and how to use algorithms and techniques to perform operations on the elements of the array.&lt;/p&gt;
&lt;p&gt;Overall, the 2D array technique is a powerful tool for working with data and solving problems in a variety of contexts, and it is an important concept to understand for those interested in computer science and data analysis.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are a few examples of Leetcode problems where the 2D array technique can be used to find the solution.&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/rotate-image/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Rotate Image&lt;/a&gt;: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/maximal-square/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Maximal Square&lt;/a&gt;: Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/spiral-matrix/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Spiral Matrix&lt;/a&gt;: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/spiral-matrix-ii/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Spiral Matrix II&lt;/a&gt;: Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/set-matrix-zeroes/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Set Matrix Zeroes&lt;/a&gt;: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In all of these problems, the 2D array technique can be used to manipulate and analyze the elements of the array in order to find the solution.&lt;/p&gt;
&lt;h5&gt;Dynamic Programming:&lt;/h5&gt;
&lt;p&gt;Dynamic programming is a technique for solving problems by breaking them down into smaller subproblems and storing the results of these subproblems to avoid redundant work. It is often used to solve problems that have overlapping subproblems, such as optimization problems or problems that involve computing the same value multiple times.&lt;/p&gt;
&lt;p&gt;Here is an example of how dynamic programming might be used to solve the Fibonacci sequence problem:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fibonacci&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fill&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fibonacciHelper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fibonacciHelper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fibonacciHelper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fibonacciHelper&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;fibonacci&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: 55&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the fibonacci function uses dynamic programming to compute the nth number in the Fibonacci sequence. The fibonacciHelper function is used to compute the Fibonacci value recursively, with a cache to store the results of previous computations to avoid redundant work.&lt;/p&gt;
&lt;p&gt;Dynamic programming can be very useful for solving problems that involve optimization or computing the same value multiple times. It is often used in competitive programming and can be an efficient way to solve certain types of problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here are a few examples of Leetcode problems where dynamic programming can be used to find the solution.&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/climbing-stairs/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Climbing Stairs&lt;/a&gt;: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/maximum-subarray/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Maximum Subarray&lt;/a&gt;: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/unique-paths/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Unique Paths&lt;/a&gt;: A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the diagram below). How many possible unique paths are there?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://leetcode.com/problems/minimum-path-sum/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Minimum Path Sum&lt;/a&gt;: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;5.&lt;a href=&quot;https://leetcode.com/problems/coin-change/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt; Coin Change&lt;/a&gt;: You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.&lt;/p&gt;
&lt;p&gt;In all of these problems, dynamic programming can be used to break the problem down into smaller subproblems and store the results of these subproblems to avoid redundant work. This can help to improve the efficiency of the solution and make it possible to solve larger or more complex problems.&lt;/p&gt;
&lt;p&gt;These are just a few examples of the many algorithms and techniques that are commonly used in competitive programming and that involve working with arrays.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;Arrays are a fundamental data structure that is commonly used in competitive programming. These are some techniques and algorithms that can be used to work with arrays and solve problems efficiently, such as linear search, binary search, sorting algorithms, prefix sums, two pointer technique, sliding window technique, 2D array techniques, and dynamic programming.&lt;/p&gt;
&lt;p&gt;To be successful in competitive programming, it is important to have a strong understanding of these techniques and be able to apply them effectively to solve problems. This may involve understanding how to access and modify elements of an array, how to iterate through the elements of an array, and how to use algorithms and techniques to perform operations on the elements of an array.&lt;/p&gt;
&lt;p&gt;Overall, the ability to effectively work with arrays is an important skill for those interested in competitive programming and can be the key to solving a wide range of problems.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Common Searching Algorithms Implementation using Javascript]]></title><description><![CDATA[Array searching is the process of looking for a specific element or value within an array. There are many different algorithms that can be used to search an array, and the choice of which one to use can depend on the size of the array, the type of elements it contains, and the desired performance characteristics. Some common array search algorithms include linear search and binary search.]]></description><link>https://codeentity.tech/array-searching/</link><guid isPermaLink="false">https://codeentity.tech/array-searching/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Array]]></category><category><![CDATA[Searching]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 11 Feb 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;Array searching is the process of looking for a specific element or value within an array. There are many different algorithms that can be used to search an array, and the choice of which one to use can depend on the size of the array, the type of elements it contains, and the desired performance characteristics. Some common array search algorithms include linear search and binary search.&lt;/p&gt;
&lt;h4&gt;Linear Search&lt;/h4&gt;
&lt;p&gt;Linear search is a simple search algorithm that involves looking at each element of the array one by one, starting at the first element, until the desired element is found. This can be done by looping through the array and comparing each element to the search key until a match is found.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of a linear search algorithm written in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;linearSearch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// search key found, return its index&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// search key not found&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Example usage&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;linearSearch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; found at index &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; not found in array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Output : 5 found at index 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Linear search has a time complexity of &lt;code&gt;O(n)&lt;/code&gt;, where n is the size of the array. This means that the time taken by the algorithm increases linearly with the size of the array.&lt;/p&gt;
&lt;h4&gt;Binary Search&lt;/h4&gt;
&lt;p&gt;Binary search is a more efficient search algorithm that involves dividing the array in half and comparing the search key to the middle element. If the search key is less than the middle element, then the algorithm repeats the process on the left half of the array. If the search key is greater than the middle element, then the algorithm repeats the process on the right half of the array. This process is repeated until the search key is found or it is determined that the search key is not present in the array.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is an example of a binary search algorithm written in JavaScript:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;binarySearch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;===&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// search key found, return its index&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// search in right half of array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// search in left half of array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// search key not found&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Example usage&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;binarySearch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; found at index &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;searchKey&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; not found in array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Output : 5 found at index 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This function takes an array and a search key as input, and returns the index of the first occurrence of the search key in the array, or -1 if the search key is not found. The function uses a while loop to repeatedly divide the search area in half until the search key is found or it is determined that the search key is not present in the array. The left and right variables keep track of the bounds of the search area, and the middle variable is calculated as the average of left and right. The value of the element at the index middle is compared to the search key, and the search area is updated accordingly. If a match is found, the index of the element is returned. If the search area becomes empty (left &gt; right), the function returns -1, indicating that the search key was not found.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s important to note that this implementation of binary search only works on sorted arrays. If the array is not sorted, the results of the search will be unpredictable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Binary search has a time complexity of &lt;code&gt;O(log n)&lt;/code&gt;, which means that the time taken by the algorithm increases logarithmically with the size of the array.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;In general, binary search is much faster than linear search for large arrays. However, it can only be used if the array is already sorted, and it requires more memory to store the sorted array. Linear search, on the other hand, can be used with unsorted arrays and requires less memory. Therefore, the choice between linear search and binary search depends on the specific requirements of the problem you are trying to solve.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Common Sorting Algorithms Implementation using Javascript]]></title><description><![CDATA[Array sorting is the process of arranging the elements of an array in a specific order, such as ascending or descending order. The order can be based on the value of the elements, or on some other criterion such as the length of the elements in the case of strings.]]></description><link>https://codeentity.tech/array-sorting/</link><guid isPermaLink="false">https://codeentity.tech/array-sorting/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Array]]></category><category><![CDATA[Sorting]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 16 Jan 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Array&lt;/strong&gt; sorting is the process of arranging the elements of an array in a specific order, such as ascending or descending order. The order can be based on the value of the elements, or on some other criterion such as the length of the elements in the case of strings.&lt;/p&gt;
&lt;p&gt;There are many different algorithms that can be used to sort arrays, and the choice of which one to use can depend on the size of the array, the type of elements it contains, and the desired performance characteristics. Some common array sorting algorithms include quicksort, mergesort, and heapsort.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/f0b4d583d9b9a7e5f321c4bc5496cc86/6a068/sorting.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 75.31645569620254%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAPABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAe7LDYP/xAAWEAEBAQAAAAAAAAAAAAAAAAABICH/2gAIAQEAAQUCXZ//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAaEAEAAwADAAAAAAAAAAAAAAABABExUZHx/9oACAEBAAE/IUKUdwU9hkRvCU8EMn//2gAMAwEAAgADAAAAEDPP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAHBABAAICAwEAAAAAAAAAAAAAAQARIVFhgaHB/9oACAEBAAE/EKYQ20lhkb2n5FYcdRlhDmBkMBfk/9k=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Array Sorting&quot;
        title=&quot;Array Sorting&quot;
        src=&quot;/static/f0b4d583d9b9a7e5f321c4bc5496cc86/828fb/sorting.jpg&quot;
        srcset=&quot;/static/f0b4d583d9b9a7e5f321c4bc5496cc86/ff44c/sorting.jpg 158w,
/static/f0b4d583d9b9a7e5f321c4bc5496cc86/a6688/sorting.jpg 315w,
/static/f0b4d583d9b9a7e5f321c4bc5496cc86/828fb/sorting.jpg 630w,
/static/f0b4d583d9b9a7e5f321c4bc5496cc86/0ede0/sorting.jpg 945w,
/static/f0b4d583d9b9a7e5f321c4bc5496cc86/6a068/sorting.jpg 960w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h4&gt;Common Sorting Algorithms&lt;/h4&gt;
&lt;h5&gt;Selection Sort&lt;/h5&gt;
&lt;p&gt;Selection sorting works by iterating through the array and selecting the minimum element at each step. The minimum element is then swapped with the current element, and the process is repeated until the array is fully sorted.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Selection Sort&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; This function takes an array as input and sorts it in ascending order using the selection sort algorithm.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;selectionSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;minIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Example&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;unsortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;selectionSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;unsortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: [1, 2, 3, 5, 7]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Selection sort has a time complexity of &lt;code&gt;O(n^2)&lt;/code&gt;, which means that the time taken by the algorithm increases quadratically with the size of the array. This makes it less efficient than some other sorting algorithms.&lt;/p&gt;
&lt;h5&gt;Bubble Sort&lt;/h5&gt;
&lt;p&gt;Bubble Sorting works by iterating through the array and comparing adjacent elements. If an element is greater than the element after it, the two elements are swapped. This process is repeated until the array is fully sorted.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Bubble Sort&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; This function takes an array as input and sorts it in ascending order using the bubble sort algorithm.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;bubbleSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;swapped&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;swapped&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;swapped&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;swapped&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Example&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;unsortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;bubbleSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;unsortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;sortedArray&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: [1, 2, 3, 5, 7]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Bubble sort also has a time complexity of &lt;code&gt;O(n^2)&lt;/code&gt;, which means that the time taken by the algorithm increases quadratically with the size of the array. This makes it less efficient than some other sorting algorithms, such as quicksort and mergesort, which have a time complexity of O(n log n). However, bubble sort is simple to implement and can be a good choice for small arrays or when memory is limited.&lt;/p&gt;
&lt;h5&gt;Insertion Sort&lt;/h5&gt;
&lt;p&gt;Insertion sort is a simple sorting algorithm that works by building up a sorted list one element at a time. It iterates through the input array and inserts each element in its correct position in the sorted list.&lt;/p&gt;
&lt;p&gt;The algorithm works by iterating over the input array and comparing each element with the elements that come before it. If an element is smaller than the one that comes before it, it is inserted in its correct position. This process continues until the entire array is sorted.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Insertion sort&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; This function takes an array as input and sorts it in ascending order using the insertion sort algorithm.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insertionSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentValue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentValue&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;insertionSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: [1, 2, 3, 4, 5, 6]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Insertion sort also has a time complexity of &lt;code&gt;O(n^2)&lt;/code&gt; in the worst case, which makes it less efficient than other sorting algorithms for large inputs. However, it has a relatively low overhead and can be useful for sorting small arrays or partially sorted arrays.&lt;/p&gt;
&lt;h5&gt;Merge Sort&lt;/h5&gt;
&lt;p&gt;Merge sort is a divide and conquer sorting algorithm that works by dividing the input array in half, sorting the two halves, and then merging them back together in a sorted manner.&lt;/p&gt;
&lt;p&gt;The merge function takes in two sorted arrays and merges them into a single sorted array. It does this by comparing the first element of each array and adding the smaller of the two to the result array. This process continues until one of the arrays is fully merged into the result array, at which point the remaining elements of the other array are simply appended to the result.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Merge sort&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; * &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-i grvsc-th1M5T-10&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; This function takes an array as input and sorts it in ascending order using the merge sort algorithm.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;mergeSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;middle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;merge&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;mergeSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;mergeSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;merge&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rightIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rightIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rightIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rightIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;])&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rightIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;concat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;leftIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;concat&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;rightIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;mergeSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: [1, 2, 3, 4, 5, 6]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Quick Sort&lt;/h5&gt;
&lt;p&gt;Quick sort is a divide and conquer sorting algorithm that works by selecting a “pivot” element from the input array and partitioning the other elements into two sub-arrays based on whether they are less than or greater than the pivot. The pivot and the sub-arrays are then sorted recursively using the same process.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;quickSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;pivotIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;partition&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;quickSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;pivotIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;quickSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;pivotIndex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;partition&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;pivot&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;pivot&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;++&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;quickSort&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;arr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Output: [1, 2, 3, 4, 5, 6]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The partition function in the example above selects the last element of the input array as the pivot and rearranges the other elements in the array such that all elements less than the pivot are placed before it and all elements greater than the pivot are placed after it. The pivot is then returned to its correct position in the sorted array by swapping it with the element at the partition index.&lt;/p&gt;
&lt;p&gt;Quick sort has a time complexity of&lt;code&gt; O(n log(n))&lt;/code&gt; in the average case and &lt;code&gt;O(n^2)&lt;/code&gt; in the worst case. It is generally faster than merge sort and can be implemented in-place (i.e., without requiring additional space), which makes it a good choice for sorting large arrays on devices with limited memory. However, it is not a stable sort, meaning that the order of elements that compare as equal may not be preserved in the sorted output.&lt;/p&gt;
&lt;h5&gt;Conclusion&lt;/h5&gt;
&lt;p&gt;Ultimately, the best sorting technique to use will depend on the specific requirements of your application, such as the size and type of the input array, the amount of available memory, and the required stability of the sort. It is often a good idea to benchmark different sorting techniques to determine the most efficient solution for your specific use case.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Data Structure and Algorithms with JS - Part 0]]></title><description><![CDATA[Data structures and algorithms are integral components of software development, as they help to organize and manipulate data in an efficient manner. In this blog post, we will discuss some common data structures and algorithms in Javascript, as well as their time complexity, which refers to the amount of time it takes for an algorithm to complete its task.]]></description><link>https://codeentity.tech/data-structure-with-js-0/</link><guid isPermaLink="false">https://codeentity.tech/data-structure-with-js-0/</guid><category><![CDATA[DSA]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sat, 01 Jan 2022 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Data structures&lt;/strong&gt; are an essential aspect of computer science and programming. They provide a way to organize and store data in a computer so that it can be accessed and modified efficiently. In this blog, we will cover some basic concepts and common data structures that you should know as a programmer.&lt;/p&gt;
&lt;h4&gt;What is a data structure?&lt;/h4&gt;
&lt;p&gt;A data structure is a way of organizing and storing data in a computer so that it can be accessed and modified efficiently. There are many different types of data structures, each with its own set of benefits and drawbacks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some common data structures include arrays, linked lists, stacks, queues, trees, and graphs&lt;/strong&gt;.&lt;/p&gt;
&lt;h5&gt;Arrays&lt;/h5&gt;
&lt;p&gt;An array is a linear data structure that stores a fixed-size sequence of elements of the same data type. The elements in an array are stored in &lt;strong&gt;contiguous memory locations&lt;/strong&gt; and can be accessed using an index. Arrays are efficient for accessing and modifying elements, but they are not very flexible when it comes to inserting and deleting elements.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 28.48101265822785%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAGABQDASIAAhEBAxEB/8QAFwABAAMAAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAdyAuD//xAAXEAEBAQEAAAAAAAAAAAAAAAAAEgEh/9oACAEBAAEFApSzj//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABQQAQAAAAAAAAAAAAAAAAAAABD/2gAIAQEABj8Cf//EABgQAAMBAQAAAAAAAAAAAAAAAAABETFx/9oACAEBAAE/IXT07YkS0//aAAwDAQACAAMAAAAQc8//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAZEAEAAwEBAAAAAAAAAAAAAAABABExYSH/2gAIAQEAAT8QfSl3SwJ7U8m6dM//2Q==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;An array in memory representation&quot;
        title=&quot;An array in memory representation&quot;
        src=&quot;/static/4fc934159308cbfa90a89e0b3dd2d365/828fb/array.jpg&quot;
        srcset=&quot;/static/4fc934159308cbfa90a89e0b3dd2d365/ff44c/array.jpg 158w,
/static/4fc934159308cbfa90a89e0b3dd2d365/a6688/array.jpg 315w,
/static/4fc934159308cbfa90a89e0b3dd2d365/828fb/array.jpg 630w,
/static/4fc934159308cbfa90a89e0b3dd2d365/29d31/array.jpg 700w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h5&gt;Linked Lists&lt;/h5&gt;
&lt;p&gt;A linked list is a linear data structure that consists of a sequence of nodes. Each node contains &lt;strong&gt;a value and a reference&lt;/strong&gt; (or pointer) to the next node in the list. Linked lists are flexible because they allow you to insert and delete elements easily, but they are not as efficient as arrays for accessing and modifying elements.
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 22.151898734177216%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAuUlEQVR42nWPwW6DMBAF8/+/V2hTMMG1DTg4RCiiMsZWpooj0lP29N6uNNo5ANwBow1V37Ak/1ixhY0YI/t471nX9W1/cu4cHuE6TRyrb2xv0VJRlAXn64hSCmMMVV2hB4OUElELiq+Szvb5LuoaOSrmuOTPMrB3A8L98HH6pGyPCCEY3Jm2bdFa05wa7Ggz4OIuSCUZRktnOpxzzMuMT+EfuKaAu03Mv7ecd6UQwksnbpGU0tu+K/8Bg7IxGU74iJ4AAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Linked List representation&quot;
        title=&quot;Linked List representation&quot;
        src=&quot;/static/e917926305fecfe9f88d63c2452c6a07/f058b/linkedlist.png&quot;
        srcset=&quot;/static/e917926305fecfe9f88d63c2452c6a07/c26ae/linkedlist.png 158w,
/static/e917926305fecfe9f88d63c2452c6a07/6bdcf/linkedlist.png 315w,
/static/e917926305fecfe9f88d63c2452c6a07/f058b/linkedlist.png 630w,
/static/e917926305fecfe9f88d63c2452c6a07/ef3e1/linkedlist.png 759w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h5&gt;Stacks&lt;/h5&gt;
&lt;p&gt;A stack is a linear data structure that follows the &lt;strong&gt;last-in, first-out (LIFO)&lt;/strong&gt; principle. It has two main operations: push and pop. Push adds an element to the top of the stack, and pop removes the element from the top of the stack. Stacks are often used to implement undo/redo functionality and to evaluate expressions.
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 59.49367088607595%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/webp;base64,UklGRkABAABXRUJQVlA4WAoAAAAQAAAAEwAACwAAQUxQSJcAAAABgFtt2/LkjrvrG3d3V3SYHDqndBkAaq9hizBFSmQN9wkiYgL4n47sJ3YvBE0YwoDWB9iw2YJOm61sw1G0RU4OXCBI5PymKBphZXWxfHcb+SR8epZPxapMn1eDsah8IiC7LzNmLzv9l5f4N9aep9w/rzWfHqIQkZBNxDnanjDZHoW2t5yQXy7QG+OYT5NZNtOoAMG5OP8SAFZQOCCCAAAAMAQAnQEqFAAMAD7RVKNLqCSjIbAIAQAaCUAToDF0oNRJzmPSnHPAEggAAP7uutxm/5KMf1RUjUVT8120cLriAcAIy6Z5Fdi8DFIdfLYQ2QH/4X/wlDrGps7ZOqTxvRBSdW9VktyVrXrtSUyjuIRCyUmSpZlwo3zMbW0VPt02/AuIAA==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Stack representation&quot;
        title=&quot;Stack representation&quot;
        src=&quot;/static/f89ff169c86171c3bfdf4a22a34ba29a/8aab1/stack.webp&quot;
        srcset=&quot;/static/f89ff169c86171c3bfdf4a22a34ba29a/81b7c/stack.webp 158w,
/static/f89ff169c86171c3bfdf4a22a34ba29a/6ea66/stack.webp 315w,
/static/f89ff169c86171c3bfdf4a22a34ba29a/8aab1/stack.webp 630w,
/static/f89ff169c86171c3bfdf4a22a34ba29a/f23e7/stack.webp 814w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h5&gt;Queues&lt;/h5&gt;
&lt;p&gt;A queue is a linear data structure that follows the &lt;strong&gt;first-in, first-out (FIFO)&lt;/strong&gt; principle. It has two main operations: enqueue and dequeue. Enqueue adds an element to the end of the queue, and dequeue removes the element from the front of the queue. Queues are often used to implement task scheduling and buffering.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 15.822784810126581%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/webp;base64,UklGRrQAAABXRUJQVlA4WAoAAAAQAAAAEwAAAgAAQUxQSD0AAAAABQoKCQc6HgoGB1BQDAMDClEtJAAFCgoJBXg2CgYJn58PAwMKoVRSDA0qJBgABCkhAAAPKRcAABspDgAAAFZQOCBQAAAAkAMAnQEqFAADAD7RWqZMqCUjojAIAQAaCWcAUwAHmX89FPaMAAD+9Xk82j3jsu9SqzkV8tnCHjQrMVpaOO+K8rmTqia3rFXTq/P4TQ2aAAA=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Queue representation&quot;
        title=&quot;Queue representation&quot;
        src=&quot;/static/3d69c9611cc9ab96c1fb11b662a99a1c/8aab1/queue.webp&quot;
        srcset=&quot;/static/3d69c9611cc9ab96c1fb11b662a99a1c/81b7c/queue.webp 158w,
/static/3d69c9611cc9ab96c1fb11b662a99a1c/6ea66/queue.webp 315w,
/static/3d69c9611cc9ab96c1fb11b662a99a1c/8aab1/queue.webp 630w,
/static/3d69c9611cc9ab96c1fb11b662a99a1c/a70f5/queue.webp 945w,
/static/3d69c9611cc9ab96c1fb11b662a99a1c/4ef06/queue.webp 1260w,
/static/3d69c9611cc9ab96c1fb11b662a99a1c/629a2/queue.webp 1892w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h5&gt;Trees&lt;/h5&gt;
&lt;p&gt;A tree is a non-linear data structure that consists of nodes organized into a hierarchy. The top node is called the root, and the nodes below it are called child nodes. Each child node may have its own child nodes, forming a sub-tree. Trees are often used to represent hierarchical relationships and to perform operations such as searching and sorting.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 83.54430379746836%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAYAAADdRIy+AAAACXBIWXMAAAsTAAALEwEAmpwYAAABS0lEQVR42qWUe0vDMBTFf3PVulFXJ/hq1bXTbTrxNXW+UBQfE8F/Bb//FxmBEwg1tjIPXJomtye5p+cGqhEBA0XEPzCn5wZwCYw1dtdmwjFwIdKjWQhCoA4kwBBYAlp6xppbU05YRbYKnOlEX8CCJ6cJfAPniqSMsAOkwCnQ9uhlx1vALTABRpqruUT2JZX4Y4fQB1P+CXCnQ/wgtNgDGtKq8wcXLAK7vgUj8Auw7cybP3pdtruwDrwDgc3LZNpXEVvE0qhfJTzwBhwAuXnZ1GBH5VoYq3Qlfrew5sKc7ErxjMhudJJiorHFI9CrKP1J8uxbDUNPciTBA5tYomEiHu+G88CyjN3S3CHwoTWLhqT4LBO3LgmG6pbA6aCRYkVhfPjg9HftN8Pmugj6znWVqbRc5k/1E+61cam1EmmWFfq3pxKb6vGB8mL36ymMrBRWbisSDQAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Tree representation&quot;
        title=&quot;Tree representation&quot;
        src=&quot;/static/59fb6826803c1ead3d42630d8b39dd3c/f058b/tree.png&quot;
        srcset=&quot;/static/59fb6826803c1ead3d42630d8b39dd3c/c26ae/tree.png 158w,
/static/59fb6826803c1ead3d42630d8b39dd3c/6bdcf/tree.png 315w,
/static/59fb6826803c1ead3d42630d8b39dd3c/f058b/tree.png 630w,
/static/59fb6826803c1ead3d42630d8b39dd3c/40601/tree.png 945w,
/static/59fb6826803c1ead3d42630d8b39dd3c/78612/tree.png 1260w,
/static/59fb6826803c1ead3d42630d8b39dd3c/e8950/tree.png 2000w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h5&gt;Graphs&lt;/h5&gt;
&lt;p&gt;A graph is a non-linear data structure that consists of a set of vertices (or nodes) and a set of edges that connect the vertices. Graphs can be directed (where the edges have a direction) or undirected (where the edges have no direction). They are often used to represent relationships and connections between data.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 35.44303797468354%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAYAAAAIy204AAAACXBIWXMAAA7DAAAOwwHHb6hkAAABC0lEQVR42l2Ri46EIAxF/f9/3NkZFRFBUHzy0Dsprs64TUhK6D30thn+Yt93fIdzDq1sYFqFaRzh3IrB9tBKQjUC3rlb/anPKDkvMYZLKDiD7boEIPDQ95CivoB0Ot3C9h3WZbmg2Qnz3iUBy5/IHz9JwPIXRMXQG53EndGoihw1K2F0i/z3Aa3UreMP0DkIXoEVLxitDtvrmn733qcPQ/DpTi7ojcBV8URvDLZtuwPPmKyB5CWkOGxR18s8J8E0DGhVAyk4alag4SUEL7HM08cyJVTc1BxV8UIMR+uDtaljOgSg2dFcqY6zAvNk07KqMk+LuwEpGa1NM/reWAwBIYSbg+A9Yoz4H+eW37iqHFrsRAL9AAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Graph representation&quot;
        title=&quot;Graph representation&quot;
        src=&quot;/static/b5b2b5757afec5dc4f605825338147f6/f058b/graph.png&quot;
        srcset=&quot;/static/b5b2b5757afec5dc4f605825338147f6/c26ae/graph.png 158w,
/static/b5b2b5757afec5dc4f605825338147f6/6bdcf/graph.png 315w,
/static/b5b2b5757afec5dc4f605825338147f6/f058b/graph.png 630w,
/static/b5b2b5757afec5dc4f605825338147f6/62de4/graph.png 746w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h4&gt;Choosing the right data structure&lt;/h4&gt;
&lt;p&gt;When choosing a data structure, it’s important to consider the operations that you will be performing on the data and the efficiency of each data structure for those operations. For example, if you need to access and modify elements frequently, an array might be a better choice than a linked list. On the other hand, if you need to insert and delete elements frequently, a linked list might be a better choice.&lt;/p&gt;
&lt;h4&gt;What is an Algorithm?&lt;/h4&gt;
&lt;p&gt;As a computer programmer, it is important to understand the basics of algorithms and time space complexity. An algorithm is a set of steps that can be followed to solve a problem. It is the foundation of computer programming and is used to create software, applications, and websites.&lt;/p&gt;
&lt;p&gt;One important aspect of algorithms is their time and space complexity, which measures how efficient an algorithm is in terms of the resources it uses. Time complexity refers to the amount of time an algorithm takes to complete its task, while space complexity refers to the amount of memory or storage space it requires.&lt;/p&gt;
&lt;h5&gt;What is Complexity Notation!?&lt;/h5&gt;
&lt;p&gt;One way to measure the efficiency of an algorithm is through the use of Big O notation. Big O notation is a way to describe the upper bound of an algorithm’s time complexity. It is typically used to describe the worst case scenario, or the maximum amount of time it will take for the algorithm to run.&lt;/p&gt;
&lt;p&gt;For example, if an algorithm has a time complexity of O(n), this means that the time it takes to run will increase linearly with the size of the input (n). An algorithm with a time complexity of O(n^2) means that the time it takes to run will increase with the square of the size of the input.&lt;/p&gt;
&lt;p&gt;Other common notations for time complexity include Omega notation (Ω), which describes the lower bound of an algorithm’s time complexity, and Theta notation (Θ), which describes both the upper and lower bounds of an algorithm’s time complexity.&lt;/p&gt;
&lt;p&gt;Here is a table comparing the different notations:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Notation&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;O&lt;/td&gt;
&lt;td&gt;Upper bound&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ω&lt;/td&gt;
&lt;td&gt;Lower bound&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Θ&lt;/td&gt;
&lt;td&gt;Both upper and lower bounds&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;There are several different types of time and space complexity cases.&lt;/p&gt;
&lt;h6&gt;The most common ones are:&lt;/h6&gt;
&lt;p&gt;&lt;strong&gt;O(n)&lt;/strong&gt; - This type represents the linear time complexity of an algorithm, where n is the size of the input data. An algorithm with an O(n) time complexity means that the time it takes to complete the task increases linearly with the size of the input data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;O(1)&lt;/strong&gt; - O(1) time complexity is considered the best possible time complexity. This represents a constant time complexity, meaning that the time it takes to complete the task does not depend on the size of the input data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;O(log n)&lt;/strong&gt; - This type represents a logarithmic time complexity, meaning that the time it takes to complete the task increases logarithmically with the size of the input data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;O(n log n)&lt;/strong&gt; - This type represents a time complexity that is a combination of linear and logarithmic.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;O(n^2)&lt;/strong&gt; - This type represents a quadratic time complexity, meaning that the time it takes to complete the task increases exponentially with the size of the input data.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 69.62025316455697%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/webp;base64,UklGRpoAAABXRUJQVlA4II4AAADwBACdASoUAA4APtFUo0uoJKMhsAgBABoJbACdMoRwIsCrgYJWA8C3SQ0cmGG7VAAA/vCO8S0XPpWGaRtRTUzvcNtEF5tqzBsrqIlbTb85i3yqwsYH8Mh37LwISLg7KEDUGpComGNP0Mz5Vm/aKdk9917/FyMXTlafr33FYHzlGcYXP7TCHg0bieY3AAAA&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Bigo cheatsheet&quot;
        title=&quot;Bigo cheatsheet&quot;
        src=&quot;/static/474430b14a44dbc60ae1cd492bbc545b/8aab1/bigochart.webp&quot;
        srcset=&quot;/static/474430b14a44dbc60ae1cd492bbc545b/81b7c/bigochart.webp 158w,
/static/474430b14a44dbc60ae1cd492bbc545b/6ea66/bigochart.webp 315w,
/static/474430b14a44dbc60ae1cd492bbc545b/8aab1/bigochart.webp 630w,
/static/474430b14a44dbc60ae1cd492bbc545b/712de/bigochart.webp 828w&quot;
        sizes=&quot;(max-width: 630px) 100vw, 630px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;
 Big-O Complexity Chart: &lt;a href=&quot;http://bigocheatsheet.com/&quot; target=&quot;_blank&quot;&gt;http://bigocheatsheet.com/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;In general, we want to choose algorithms with the lowest possible time complexity. However, it’s important to keep in mind that time complexity is just one factor to consider when choosing an algorithm. Other factors, such as the simplicity of the algorithm and the amount of space it requires, may also be important considerations.&lt;/p&gt;
&lt;p&gt;Overall, understanding algorithm and time space complexity is crucial for choosing the most efficient solution to a problem. By using the different types and understanding their meanings, we can better evaluate the efficiency of different algorithms and choose the one that best fits our needs.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Basics of Markdown - Syntax and Examples]]></title><description><![CDATA[Markdown is a lightweight markup language that is used to format text on the web. It was created in 2004 by John Gruber, a software developer, and Aaron Swartz, an internet activist, as a way to write and format text in a simple and straightforward manner.]]></description><link>https://codeentity.tech/basic-markdown/</link><guid isPermaLink="false">https://codeentity.tech/basic-markdown/</guid><category><![CDATA[Markdown]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 28 Nov 2021 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Markdown&lt;/strong&gt; is a lightweight markup language that is used to format text on the web. It was created in 2004 by John Gruber, a software developer, and Aaron Swartz, an internet activist, as a way to write and format text in a simple and straightforward manner.&lt;/p&gt;
&lt;p&gt;Markdown is written in plain text, which means you can use any text editor to write in it. It uses a set of special characters and symbols to indicate formatting, such as bold, italic, and headers. This makes it easy to read and write, as you don’t have to use complex formatting tools or HTML tags.&lt;/p&gt;
&lt;h5&gt;Here is a table of the most common Markdown syntax:&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;Syntax&lt;/th&gt;
&lt;th align=&quot;left&quot;&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes a heading. The number of &lt;code&gt;#&lt;/code&gt; symbols indicates the heading level (e.g. # is a top-level heading, &lt;code&gt;##&lt;/code&gt; is a second-level heading, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;*&lt;/strong&gt; , &lt;strong&gt;-&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes a bullet point in a list.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;1.&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes a numbered list.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;[text](url)&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes a link. The &lt;code&gt;text&lt;/code&gt; is the text that will be displayed, and the &lt;code&gt;url&lt;/code&gt; is the link destination.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;**text**&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes bold text.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;_text_&lt;/strong&gt; , &lt;strong&gt;*text*&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes italic text.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes a blockquote.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;``` code ```&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes a code block. Anything between the backticks will be formatted as code.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;![alt text](image url)&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes an image. The alt text is a description of the image, and the image url is the location of the image.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;___&lt;/strong&gt;&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Denotes an horizontal Line&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Here are some examples of how these syntax elements can be used in Markdown:&lt;/h5&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;# Heading Level 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;## Heading Level 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;### Heading Level 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;#### Heading Level 4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;##### Heading Level 5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;###### Heading Level 6&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;* Bullet point 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;* Bullet point 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;* Bullet point 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;1. Numbered list item 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;2. Numbered list item 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;3. Numbered list item 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;horizontal line&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;- Unordered List item 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;- Unordered List item 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;- Unordered List item 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;[Link example](http://example.com)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;![alt text](https://images.unsplash.com/photo-1541364983171-a8ba01e95cfc?ixlib=rb-4.0.3&amp;amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;amp;auto=format&amp;amp;fit=crop&amp;amp;w=387&amp;amp;q=80)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;**Bold text**&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;*Italic text*&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&amp;gt; Blockquote&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;`Single line of code`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;```&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;Multiline of code&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;Next line&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;Last line&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;```&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Preview of above markdown&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Heading Level 1&lt;/h1&gt;
&lt;h2&gt;Heading Level 2&lt;/h2&gt;
&lt;h3&gt;Heading Level 3&lt;/h3&gt;
&lt;h4&gt;Heading Level 4&lt;/h4&gt;
&lt;h5&gt;Heading Level 5&lt;/h5&gt;
&lt;h6&gt;Heading Level 6&lt;/h6&gt;
&lt;ul&gt;
&lt;li&gt;Bullet point 1&lt;/li&gt;
&lt;li&gt;Bullet point 2&lt;/li&gt;
&lt;li&gt;Bullet point 3&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;Numbered list item 1&lt;/li&gt;
&lt;li&gt;Numbered list item 2&lt;/li&gt;
&lt;li&gt;Numbered list item 3&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;p&gt;horizontal line&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unordered List item 1&lt;/li&gt;
&lt;li&gt;Unordered List item 2&lt;/li&gt;
&lt;li&gt;Unordered List item 3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;http://example.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Link example&lt;/a&gt; &lt;/br&gt;
&lt;img src=&quot;https://images.unsplash.com/photo-1541364983171-a8ba01e95cfc?ixlib=rb-4.0.3&amp;#x26;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;#x26;auto=format&amp;#x26;fit=crop&amp;#x26;w=387&amp;#x26;q=80&quot; alt=&quot;alt text&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bold text&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Italic text&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Blockquote&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;code&gt;Single line of code&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;Multiline of code&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;Next line&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;Last line&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, Markdown is a simple and easy-to-use language that allows you to format text for the web without the need for complex tools or HTML tags. It is widely used in blogging platforms, online forums, and even in version control systems like Git.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Checkout my markdown previewer project&lt;/strong&gt; &lt;/br&gt;
&lt;a href=&quot;https://github.com/iamvishal345/markdown-previewer&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/iamvishal345/markdown-previewer?label=Fork%20Complete%20Project&amp;amp;style=social&quot;&gt;&lt;/a&gt;
&lt;a href=&quot;https://github.com/iamvishal345/markdown-previewer&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/iamvishal345/markdown-previewer?label=Demo&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Hiding an Element with CSS: Display vs Visibility vs Opacity]]></title><description><![CDATA[CSS offers various ways to hide elements on a web page, but it's important to understand the differences between them in order to choose the right one for your specific use case. In this blog post, we will explore the display: none, visibility: hidden, and opacity: 0 properties and how they can be used to hide elements.]]></description><link>https://codeentity.tech/hiding-an-element-css/</link><guid isPermaLink="false">https://codeentity.tech/hiding-an-element-css/</guid><category><![CDATA[CSS]]></category><category><![CDATA[This vs That]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 17 Sep 2021 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt; offers various ways to hide elements on a web page, but it’s important to understand the differences between them in order to choose the right one for your specific use case. In this blog post, we will explore the &lt;code&gt;display: none&lt;/code&gt;, &lt;code&gt;visibility: hidden&lt;/code&gt;, and &lt;code&gt;opacity: 0&lt;/code&gt; properties and how they can be used to hide elements.&lt;/p&gt;
&lt;h6&gt;Here’s a quick comparison table:&lt;/h6&gt;
&lt;div class=&quot;custom-blog-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&quot;left&quot;&gt;Property&lt;/th&gt;
&lt;th align=&quot;left&quot;&gt;Description&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Collapses&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Events&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Tab Order&lt;/th&gt;
&lt;th align=&quot;center&quot;&gt;Animatable&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;display: none&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Hides an element and takes up no space in the layout&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;visibility: hidden&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Hides an element but takes up space in the layout&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&quot;left&quot;&gt;opacity: 0&lt;/td&gt;
&lt;td align=&quot;left&quot;&gt;Makes an element fully transparent but still takes up space in the layout&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;❌&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;td align=&quot;center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
##### display: none
&lt;p&gt;The &lt;code&gt;display&lt;/code&gt; property determines how an element is displayed on the web page. The none value completely removes the element from the document, including all its children. This means that the element will not take up any space on the page and will not be visible to the user.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;css&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;toggle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One important thing to note about &lt;code&gt;display: none&lt;/code&gt; is that it not only hides the element, but it also removes it from the document entirely. This means that any events or interactions associated with the element will no longer work. For example, if the element is a button that triggers an action when clicked, that action will no longer be triggered when the button is hidden using&lt;code&gt; display: none&lt;/code&gt;.&lt;/p&gt;
&lt;h5&gt;visibility: hidden&lt;/h5&gt;
&lt;p&gt;Unlike &lt;code&gt;display: none&lt;/code&gt;, the &lt;code&gt;visibility: hidden&lt;/code&gt; property does not remove the element from the document. Instead, it only hides the element and leaves empty space where the element would have been.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;css&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;toggle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;visibility&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This can be useful in cases where you want to hide an element but still want to preserve its layout and keep its space on the page. For example, if you have a navigation menu with multiple items and you want to hide one of the items temporarily, using &lt;code&gt;visibility: hidden&lt;/code&gt; will allow you to keep the layout of the menu intact.&lt;/p&gt;
&lt;h5&gt;opacity: 0&lt;/h5&gt;
&lt;p&gt;The &lt;code&gt;opacity&lt;/code&gt; property determines the transparency of an element. A value of &lt;code&gt;0&lt;/code&gt; means that the element is completely transparent and not visible to the user.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;css&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;toggle&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Like &lt;code&gt;visibility: hidden&lt;/code&gt;, &lt;code&gt;opacity: 0&lt;/code&gt; does not remove the element from the document. It only makes the element transparent, so it will still take up space on the page and any events or interactions associated with the element will still work.&lt;/p&gt;
&lt;h5&gt;Choosing the right property&lt;/h5&gt;
&lt;p&gt;When it comes to hiding elements, you should choose the right property based on your specific needs. Here are some general guidelines to help you make the right decision:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you want to completely remove the element from the document and change layout, use &lt;code&gt;display: none&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If you want to hide the element but preserve its layout and space on the page, use &lt;code&gt;visibility: hidden&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If you want to hide the element but still allow it to interact with the user, use &lt;code&gt;opacity: 0&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It’s important to note that these properties can be used in combination with each other, depending on your needs. For example, you can use &lt;code&gt;opacity: 0&lt;/code&gt; to make an element transparent and &lt;code&gt;visibility: hidden&lt;/code&gt; to hide it, or you can use &lt;code&gt;display: none&lt;/code&gt; to remove an element from the document and &lt;code&gt;opacity: 0&lt;/code&gt; to make it transparent.
This is useful when you are adding a complex animation using keyframes and need to have different behaviors in animation cycle.&lt;/p&gt;
&lt;h5&gt;Conclusion&lt;/h5&gt;
&lt;p&gt;In conclusion, the &lt;code&gt;display:none&lt;/code&gt;, &lt;code&gt;visibility:hidden&lt;/code&gt;, and &lt;code&gt;opacity:0&lt;/code&gt; CSS properties are all useful for hiding elements on a webpage. &lt;code&gt;display:none&lt;/code&gt; completely removes the element from the page, while &lt;code&gt;visibility:hidden&lt;/code&gt; and &lt;code&gt;opacity:0&lt;/code&gt; only hide the element but still take up space on the page. It’s important to consider which one is most appropriate for the specific situation, as they can affect the layout and functionality of the page in different ways. Understanding and utilizing these properties can help create a more polished and visually appealing website.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[CSS Pre Processors- SASS]]></title><description><![CDATA[CSS preprocessors are tools that allow you to write more efficient and maintainable CSS code. They extend the capabilities of plain CSS by adding features such as variables, mixins, and functions, which can help you write more modular and scalable stylesheets.]]></description><link>https://codeentity.tech/css-preprocessors/</link><guid isPermaLink="false">https://codeentity.tech/css-preprocessors/</guid><category><![CDATA[CSS]]></category><category><![CDATA[SASS]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 15 Aug 2021 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;CSS preprocessors&lt;/strong&gt; are tools that allow you to write more efficient and maintainable CSS code. They extend the capabilities of plain CSS by adding features such as variables, mixins, and functions, which can help you write more modular and scalable stylesheets.&lt;/p&gt;
&lt;p&gt;There are several popular CSS preprocessors available, including Sass, Less, and Stylus. In this blog, we’ll take a look at Sass and provide some examples of how it can be used to make your CSS more efficient and maintainable.&lt;/p&gt;
&lt;h4&gt;What is Sass?&lt;/h4&gt;
&lt;p&gt;Sass (short for Syntactically Awesome Stylesheets) is a CSS preprocessor that adds features such as variables, mixins, and functions to CSS. It is written in Ruby, but can be used with any project regardless of the programming language being used. Sass files have a .scss extension and are compiled into regular CSS files that can be used in any web project.&lt;/p&gt;
&lt;h4&gt;Why use Sass?&lt;/h4&gt;
&lt;p&gt;There are several benefits to using Sass in your web projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h5&gt;Maintainability&lt;/h5&gt;
&lt;p&gt;Sass allows you to use variables and mixins, which can make your CSS code more maintainable by allowing you to define styles in a single place and reuse them throughout your stylesheets. This can help reduce duplication and make it easier to update your styles in the future.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h5&gt;Modularity&lt;/h5&gt;
&lt;p&gt;Sass allows you to use import statements to split your stylesheets into smaller, more manageable files. This can make it easier to organize your code and keep your stylesheets organized and easy to read.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h5&gt;Functionality&lt;/h5&gt;
&lt;p&gt;Sass adds features such as functions and operators, which can help you write more efficient and powerful stylesheets. For example, you can use functions to perform calculations and generate styles dynamically, or use operators to concatenate strings or perform other operations.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;How to use Sass&lt;/h4&gt;
&lt;p&gt;To use Sass in your project, you’ll need to install a Sass compiler. There are several options available, including the command-line sass compiler, preprocessor plugins for popular text editors, and compilers like &lt;code&gt;dart-sass&lt;/code&gt; to integrate with build tools like &lt;code&gt;webpack&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once you have a Sass compiler installed, you can start using Sass in your project by creating &lt;code&gt;.scss&lt;/code&gt; files and using the &lt;code&gt;@import&lt;/code&gt; directive to include them in your main stylesheet.&lt;/p&gt;
&lt;p&gt;Here’s an example of how you might use Sass in a project (We will be using &lt;code&gt;scss&lt;/code&gt; syntax in this blog to write sass code):&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Define a variable for the primary color&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$primary-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-5&quot;&gt;333&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Define a mixin for reusable styles&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;mixin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-webkit-border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-ms-border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Use the mixin and the variable in your styles&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$primary-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;include&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;333&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-webkit-border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-ms-border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, Sass allows you to use variables and mixins to make your CSS more maintainable and efficient. There are many more features available in Sass, including functions, operators, and control directives such as &lt;code&gt; @if, @else, @while, @for, @each&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;Conditional Execution @if&lt;/h4&gt;
&lt;p&gt;As you’d expect, the Sass &lt;code&gt;@if&lt;/code&gt; directive and its companions &lt;code&gt;@else if&lt;/code&gt; and &lt;code&gt;@else&lt;/code&gt;, allow you to include Sass code in the CSS output only if certain conditions are met. The basic syntax is simple:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$age&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;27&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;bg-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$age&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$test&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;else &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;bg-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Conditional Looping - @while&lt;/h4&gt;
&lt;p&gt;As its name implies, the @while directive will continue to output CSS produced by the statements while the condition returns true.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;⚠️ Heads up!&lt;/strong&gt;
Although&lt;code&gt; @while&lt;/code&gt; is necessary for a few particularly complex stylesheets, you’re usually better of using either &lt;code&gt;@each&lt;/code&gt; or &lt;code&gt;@for&lt;/code&gt; if either of them will work. They’re clearer for the reader, and often faster to compile as well.&lt;/p&gt;
&lt;h4&gt;Unconditional Looping @for&lt;/h4&gt;
&lt;p&gt;You can use the @for directive to execute a group of statement a specific number of times. It has two variations. The first, which uses the &lt;code&gt;through&lt;/code&gt; keyword, executes the statements from &lt;start&gt; to &lt;end&gt;, inclusive and replacing the &lt;code&gt;through&lt;/code&gt; keyword with &lt;code&gt;to&lt;/code&gt; makes the loop exclusive, that is, it will not be executed when the variable is equal to &lt;end&gt;:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;through&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;font-size-3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Map through list or map @each&lt;/h4&gt;
&lt;p&gt;Finally, the &lt;code&gt;@each&lt;/code&gt; directive will execute a set of items in either a list or a map. For such a powerful structure, the syntax is quite straightforward:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//List&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$direction&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$direction&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$direction&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-center&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Map&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;xs&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;sm&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;lg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;xl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$font-map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// when this Sass code is compiled, it will output the following CSS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-xs&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-sm&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-md&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-lg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;text-xl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Functions &amp;#x26; Mixins&lt;/h3&gt;
&lt;p&gt;SCSS also supports &lt;strong&gt;functions&lt;/strong&gt; and &lt;strong&gt;mixins&lt;/strong&gt;.&lt;/p&gt;
&lt;h4&gt;Functions&lt;/h4&gt;
&lt;p&gt;Functions allow you to perform operations on values and return a result. For example, you can use the &lt;code&gt;darken&lt;/code&gt; function to reduce the lightness of a color by a given percentage:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;color: darken(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;ff0000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;, 20%)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;SCSS also have a number of built-in &lt;a href=&quot;https://sass-lang.com/documentation/modules&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;modules&lt;/a&gt; with functions for working with values and styles. Here are some examples of the types of functions that are available in SCSS:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;color&lt;/strong&gt; module. Some functions from color module are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;rgb(): The rgb() function allows you to specify a color using the red, green, and blue channels.&lt;/li&gt;
&lt;li&gt;opacify(): The opacify() function increases the opacity of a color.&lt;/li&gt;
&lt;li&gt;transparentize(): The transparentize() function decreases the opacity of a color.&lt;/li&gt;
&lt;li&gt;lighten(): The lighten() function increases the lightness of a color by a given percentage.&lt;/li&gt;
&lt;li&gt;darken(): The darken() function decreases the lightness of a color by a given percentage.&lt;/li&gt;
&lt;li&gt;saturate(): The saturate() function increases the saturation of a color by a given percentage.&lt;/li&gt;
&lt;li&gt;desaturate(): The desaturate() function decreases the saturation of a color by a given percentage.&lt;/li&gt;
&lt;li&gt;grayscale(): The grayscale() function converts a color to grayscale.&lt;/li&gt;
&lt;li&gt;complement(): The complement() function returns the complement of a color.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;math&lt;/strong&gt; module. Some functions from math module are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;abs(): The abs() function returns the absolute value of a number. &lt;code&gt;width: abs(-100px); // 100px&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;ceil(): The ceil() function returns the smallest integer that is greater than or equal to a number. &lt;code&gt;width: ceil(99.5px); // 100px&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;floor(): The floor() function returns the largest integer that is less than or equal to a number. &lt;code&gt;width: floor(99.5px); // 99px&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;max(): The max() function returns the maximum value in a list of numbers. &lt;code&gt;width: max(100px, 200px, 300px); // 300px&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;min(): The min() function returns the minimum value in a list of numbers. &lt;code&gt;width: min(100px, 200px, 300px); // 100px&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;percentage(): The percentage() function converts a number to a percentage. &lt;code&gt;width:percentage(math.div(100px, 50px)); // 200%&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;string&lt;/strong&gt; module. Some functions from string module are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;unquote(): The unquote() function removes quotes from a string.&lt;/li&gt;
&lt;li&gt;quote(): The quote() function adds quotes to a string.&lt;/li&gt;
&lt;li&gt;str-length(): The str-length() function returns the length of a string. &lt;code&gt;width: str-length(&quot;Hello, world!&quot;); // 13&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;to-upper-case(): The to-upper-case() function converts a string to uppercase.&lt;/li&gt;
&lt;li&gt;to-lower-case(): The to-lower-case() function converts a string to lowercase.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;list&lt;/strong&gt; module. Some functions from list module are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;length(): The length() function returns the length of a list.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;8&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;width: length(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// 3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;nth(): The nth() function returns the nth element of a list.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;9&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;width: nth(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;, 2)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// 2px&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;join(): The join() function concatenates two lists.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;&quot; data-index=&quot;10&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;```scss&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;$list1: 1px 2px;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;$list2: 3px 4px;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;width: join($list1, $list2); // 1px 2px 3px 4px&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;```&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;append(): The append() function adds an element to the end of a list.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;11&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;width: append(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;, 3px)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// 1px 2px 3px&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;map&lt;/strong&gt; module. Some functions from map module are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;map-get(): The map-get() function retrieves the value for a given key in a map.&lt;/li&gt;
&lt;li&gt;map-merge(): The map-merge() function merges two maps together. If the maps have overlapping keys, the values from the second map will overwrite the values from the first map.&lt;/li&gt;
&lt;li&gt;map-remove(): The map-remove() function removes a key-value pair from a map.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Mixins&lt;/h4&gt;
&lt;p&gt;Mixins, on the other hand, allow you to define a set of styles that can be reused throughout your stylesheet. For example, you might define a mixin for a common button style:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;12&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;mixin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;fff&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can then use the mixin in your stylesheet by including it using the &lt;code&gt;@include&lt;/code&gt; directive:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;13&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;include&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Mixins can also accept arguments, allowing you to customize the styles that are included. For example:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;scss&quot; data-index=&quot;14&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;mixin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;fff&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;$color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-7&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;include&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-5&quot;&gt;000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Overall, functions and mixins are powerful features of SCSS that allow you to write more efficient and maintainable stylesheets. By using these features, you can write code that is easier to read and understand, and that can be easily reused throughout your application.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[HTTP Status Code for web developers]]></title><description><![CDATA[As a web developer, it's important to understand the various HTTP status codes that can be returned from a server. These codes serve as a way to communicate the status of a request, and can range from successful responses to errors and even server issues.]]></description><link>https://codeentity.tech/http-status-code-every-webdev-know/</link><guid isPermaLink="false">https://codeentity.tech/http-status-code-every-webdev-know/</guid><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Tue, 22 Jun 2021 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;HTTP&lt;/strong&gt; status codes are a crucial part of the World Wide Web, as they provide important information about the status of a given HTTP request. These codes are sent back to the client from the server in response to a request, and they indicate whether the request was successful, or if there was an error.&lt;/p&gt;
&lt;p&gt;There are many different HTTP status codes, each with its own specific meaning. For example, the code &lt;code&gt;200&lt;/code&gt; indicates that a request was successful, while the code &lt;code&gt;404&lt;/code&gt; indicates that the requested resource could not be found. Other codes include &lt;code&gt;301&lt;/code&gt;for a permanent redirect, “403” for a forbidden request, and &lt;code&gt;500&lt;/code&gt; for a server error.&lt;/p&gt;
&lt;p&gt;One of the most important things to understand about HTTP status codes is that they help to provide more detailed information about a given request. This can be particularly useful for troubleshooting, as it can help to identify where a problem might be occurring in the communication between a client and a server.&lt;/p&gt;
&lt;h4&gt;200 Series Status Codes&lt;/h4&gt;
&lt;p&gt;One of the most commonly seen HTTP status codes is the 200 series. These codes indicate that a request was successful, and that the requested information has been returned to the client. For example, a 200 OK status means that the request was received and understood, and the requested resource has been returned.&lt;/p&gt;
&lt;h5&gt;200 - OK&lt;/h5&gt;
&lt;p&gt;The first status code is 200 and is just a generic success status. All this says is that request was received and understood, and the requested resource has been returned but it doesn’t give any more information than that. Because of this, the 200 status is the fallback status you should use for any successful request when there is no more specific code to use instead.&lt;/p&gt;
&lt;h5&gt;201 - Created&lt;/h5&gt;
&lt;p&gt;Speaking of more specific codes, we have the 201 code. This is a success code that says a resource was successfully created. Most often you will see this as the result of a POST request since most POST requests are used for creating things. For example, if you have an API route for creating a new entry in your DB you should return a 201 if that entry was created successfully.&lt;/p&gt;
&lt;h5&gt;202 - Accepted&lt;/h5&gt;
&lt;p&gt;The 202 status code is a bit niche. Essentially, this code just means that the response was successfully received, but that the actual action of the request (creating a resource, updating data, etc.) has not been completed yet. This is commonly used when doing a particular task is very slow so it gets queued up to do later. For example, if you need to generate a large report that you will later email to a user then you may return a 202 to let the client know you are processing the request but have not finished it yet.&lt;/p&gt;
&lt;h5&gt;204 - No Content&lt;/h5&gt;
&lt;p&gt;Another specific code is the 204 code which means the request was successful, but there is no data to return. This is very common with DELETE requests since there is usually no data to return as a response to deleting something. The biggest key to this status code is that it cannot contain any data in the body.&lt;/p&gt;
&lt;h4&gt;300 Series Status Codes&lt;/h4&gt;
&lt;p&gt;Another commonly seen series is the 300 series, which indicates that the requested resource has been moved or redirected. For example, a 301 Moved Permanently status indicates that the resource has been permanently moved to a new location, and any future requests should be directed to the new location.&lt;/p&gt;
&lt;h5&gt;301 - Moved Permanently&lt;/h5&gt;
&lt;p&gt;Probably the most common type of 300 series status code is the 301. This just says that the resource has been permanently moved to a new location, and any future requests should be directed to the new location. This new URL must be sent down in the response with the 301 code. If this happens the browser will automatically redirect users to the new URL. This will also trigger search engines to associate all data from the old URL with the new URL so you shouldn’t lose any rankings in a search engine by doing this.&lt;/p&gt;
&lt;h5&gt;302 - Found&lt;/h5&gt;
&lt;p&gt;Similar to the 301 status this status is used to tell the client that the page is at a new URL but this is a temporary change. This means that search engines won’t replace the old URL with this new URL. This is useful if you need to send a user to a different version of the same page, but don’t want that version of the page to replace your main version in search engines. For example, if you are doing A/B tests you would 302 redirect half your users to the alternate version of the site. This is also useful for things like localization where you may want to redirect users to localized versions of your site based on where they are from.&lt;/p&gt;
&lt;h5&gt;304 - Not Modified&lt;/h5&gt;
&lt;p&gt;The final important 300 series status code is the 304. This is used for caching and essentially just says that the resource being requested has not changed. This needs to be used in conjunction with a previous 200 status request that included caching headers such as the Cache-Control, and Expires header. When a client tries to access a resource before the cached time period has expired the server will return a 304 to prevent having to retransmit all the data to the client.&lt;/p&gt;
&lt;h5&gt;400 Series Status Codes&lt;/h5&gt;
&lt;p&gt;The 400 series of HTTP status codes indicates that there was an error with the request made by the client. This could be due to a malformed request, missing parameters, or other issues. For example, a 404 Not Found status indicates that the requested resource could not be found on the server.&lt;/p&gt;
&lt;h4&gt;400 - Bad Request&lt;/h4&gt;
&lt;p&gt;Similar to the 200 status code, the 400 status code represents a generic bad request. This just means that data being sent to the request (URL params, JSON, etc.) is incorrect, malformed, missing, or in some way unusable by the server. This is the default status message to send back when you have a request that cannot be handled due to the client. For example, if you try to send a request to create a new user but don’t pass a name the server will send a 400 status code to let you know the name field is required.&lt;/p&gt;
&lt;h5&gt;401 - Unauthorized&lt;/h5&gt;
&lt;p&gt;The 401 status code is a bit confusing since while it uses the word unauthorized (which means you don’t have permission) this status code actually means you are unauthenticated. The main difference here is that being unauthenticated means you are not logged in or attempted to log in with invalid credentials. This can happen if you pass along an invalid API key or no API key at all when dealing with APIs.&lt;/p&gt;
&lt;h5&gt;403 - Forbidden&lt;/h5&gt;
&lt;p&gt;When dealing with permissions you should use the 403 status code. This status informs the client that they do not have permission to perform this request. This should only be returned if the client is sending along valid credentials (such as a valid API key), but lack the permissions to do the action. For example, if a basic user tries to access admin data you would return a 403.&lt;/p&gt;
&lt;h5&gt;404 - Not Found&lt;/h5&gt;
&lt;p&gt;This is the most common HTTP status code people are aware of and it just means the resource could not be found. This could be used for example if you try to access a URL that does not exist or if you try to access something from the database that does not exist.&lt;/p&gt;
&lt;h5&gt;429 - Too Many Requests&lt;/h5&gt;
&lt;p&gt;The final important 400 series status code is 429. This code is used when dealing with rate limiting. For example, if you only allow users to access your API 30 times per minute and someone tries to access it 31 times you would return a 429 status code to let them know they need to wait to send their next request. This also must have a Retry-After HTTP header with the amount of time to wait before requests will be accepted by the API.&lt;/p&gt;
&lt;h4&gt;500 Series Status Codes&lt;/h4&gt;
&lt;p&gt;Finally, the 500 series of HTTP status codes indicates an error on the server side. This could be due to a server malfunction, a misconfigured server, or other issues. For example, a 500 Internal Server Error indicates that the server encountered an unexpected condition and was unable to complete the request.&lt;/p&gt;
&lt;h5&gt;500 - Internal Server Error&lt;/h5&gt;
&lt;p&gt;By far the most common 500 series code is 500. This code just informs the client there was some form of error on the server. This error could be due to anything from an error in the code leading to the program crashing (even if this error is caused by bad client data), to problems accessing the database. This should be used in any situation where the server has an error and there is no more specific code that is applicable.&lt;/p&gt;
&lt;h5&gt;503 - Service Unavailable&lt;/h5&gt;
&lt;p&gt;There aren’t too many other 500 series status codes you will use, but 503 is somewhat common. This status code just means that the server is not able to handle the request. This is common to use when doing some form of planned server maintenance where the server is down while being updated. This should also include a Retry-After HTTP header with the estimated time until the server will be back up.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;In addition to providing useful information for troubleshooting, HTTP status codes are also important for optimizing the performance of a website. By understanding the different codes and their meanings, web developers can ensure that their site is returning the appropriate status codes for each request, which can help to improve the user experience and increase the overall efficiency of the site.&lt;/p&gt;
&lt;p&gt;Overall, HTTP status codes are an essential part of the web, and they play a vital role in helping to ensure that communication between clients and servers is smooth and efficient. By understanding the different codes and their meanings, we can better understand how the web works, and how to optimize the performance of our own websites.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Top ReactJS Best Practices and Tips to Follow]]></title><description><![CDATA[React.js is a popular JavaScript library for building user interfaces. It allows developers to create reusable components and efficiently update and render them in response to user interactions. While it offers many benefits, it’s important to follow best practices to ensure a smooth and efficient development process.]]></description><link>https://codeentity.tech/react-tips-best-practices/</link><guid isPermaLink="false">https://codeentity.tech/react-tips-best-practices/</guid><category><![CDATA[React]]></category><category><![CDATA[JS Frameworks]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 16 May 2021 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;React.js&lt;/strong&gt; is a popular JavaScript library for building user interfaces. It allows developers to create reusable components and efficiently update and render them in response to user interactions.&lt;/p&gt;
&lt;p&gt;React created as a JavaScript library that allows integration with many exciting components. Interestingly, React as a library also allows developers to create their own components and share them with other developers. As UI (user interface) is an integral ingredient in app development, React is useful for UI developers determining enhanced user experiences and efficacy. Thus, React is useful for creating exceptional UI, leveraging complex UI to component-based UI. It further allows developers to utilize the small UI components for development to React native iOS and Android applications.&lt;/p&gt;
&lt;p&gt;While it offers many benefits, it’s important to follow best practices to ensure a smooth and efficient development process.&lt;/p&gt;
&lt;p&gt;As we discuss the advantages of React, now let’s check some of the most fundamental React best practices to follow in 2022:&lt;/p&gt;
&lt;h5&gt;1. Keep Components Small and Reusable&lt;/h5&gt;
&lt;p&gt;One of the key best practices in React is to keep your components small and focused. This means breaking down complex components into smaller, more modular pieces. This not only helps with readability and maintainability, but it also allows for better reuse and testing of individual components.&lt;/p&gt;
&lt;h5&gt;2. Use Functional Components&lt;/h5&gt;
&lt;p&gt;Another important practice is to use functional components wherever possible. These are components that are defined as a function, rather than a class. Functional components are simpler, easier to test, and can often be optimized for performance by React’s virtual DOM. With react &lt;code&gt;v16.8&lt;/code&gt; react introduced &lt;a href=&quot;https://reactjs.org/blog/2019/02/06/react-v16.8.0.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;hooks&lt;/a&gt;. Hooks let you use state and other React features without writing a class. You can also build your own Hooks to share reusable stateful logic between components.&lt;/p&gt;
&lt;h5&gt;3. Keep State at lowest possible level&lt;/h5&gt;
&lt;p&gt;It’s also important to properly manage your component state. In React, state is an object that holds the values that determine a component’s behavior and render data to the user. Mismanaging state can lead to unexpected behavior and unnecessary re-renders. To avoid this, try to keep your state as simple as possible and avoid storing complex data structures in it. Also you should keep state at lowest possible level as updating state will trigger rerender for entire subtree from that component. If you are storing data at global level you should use &lt;a href=&quot;https://github.com/reduxjs/reselect&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;reselect&lt;/a&gt; for state memoization or you can also use &lt;code&gt;useSelector&lt;/code&gt; hook from &lt;code&gt;react-redux v7.1.0&lt;/code&gt; and react &lt;code&gt;react v18.3.0&lt;/code&gt;.&lt;/p&gt;
&lt;h5&gt;4. Avoid index as key in list&lt;/h5&gt;
&lt;p&gt;Another best practice is to avoid using index keys in your lists. In React, it’s common to render a list of items using the map() function. However, using the index as the key can lead to inefficient updates and re-renders. Instead, try to use a unique identifier for each item in the list. Using index as key can lead to some functional issues also if you are rendering some interactive component like an input as list item.&lt;/p&gt;
&lt;h5&gt;5. Organize components into logical folders&lt;/h5&gt;
&lt;p&gt;Lastly, it’s important to properly structure your React application. This means organizing your components into logical folders, keeping your file and folder names consistent, and using descriptive names for your components. This will help with readability and maintainability as application grows and number of components increase, and make it easier for others to understand and work with your code.&lt;/p&gt;
&lt;p&gt;In summary, following best practices in React can help ensure a smooth and efficient development process. This includes keeping components small and focused, using functional components, properly managing state, avoiding index keys in lists, and properly structuring your application. By following these practices, you can create scalable and maintainable React applications.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Server Side Rendering React using Express Server]]></title><description><![CDATA[Server-side rendering with React and Express is a powerful way to provide fast and dynamic page content to users. With server-side rendering, your React components are rendered on the server and then sent to the client. This allows for faster initial page loads and improved search engine optimization.]]></description><link>https://codeentity.tech/ssr-react-express/</link><guid isPermaLink="false">https://codeentity.tech/ssr-react-express/</guid><category><![CDATA[Express]]></category><category><![CDATA[React]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sun, 07 Mar 2021 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Server-side rendering&lt;/strong&gt; with React and Express is a powerful way to provide fast and dynamic page content to users. With server-side rendering, your React components are rendered on the server and then sent to the client. This allows for faster initial page loads and improved search engine optimization.&lt;/p&gt;
&lt;p&gt;One of the most popular libraries for server-side rendering with React is Express. Express is a web application framework for Node.js that makes it easy to set up a server and handle HTTP requests.&lt;/p&gt;
&lt;p&gt;To use server-side rendering with React and Express, you’ll need to do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up an Express server and create a route to handle rendering your React components.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;ReactDOMServer.renderToString()&lt;/code&gt; or &lt;code&gt;ReactDOMServer.renderToStream()&lt;/code&gt; to render your components to a string on the server.&lt;/li&gt;
&lt;li&gt;Pass the rendered components to your server-side template, which will be used to generate the final HTML to be sent to the client.&lt;/li&gt;
&lt;li&gt;Browser will render the static html and after react bundle finish downloading it will hydrate the static html to attach all required event listeners.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here’s an example of how to render React page on server:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//server/index.js&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//React build in /build folder&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;ReactDOMServer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;react-dom/server&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;../src/App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// your React component&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;filePath&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;__dirname&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;readFile&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;filePath&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;utf8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;htmlData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;404&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// render the app as a string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;ReactDOMServer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;renderToString&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// inject the rendered app into html and send it&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;htmlData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;div id=&amp;quot;root&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, when a user navigates to the root &lt;code&gt;/&lt;/code&gt; route, the App React component is rendered to a string using &lt;code&gt;ReactDOMServer.renderToString()&lt;/code&gt;. This rendered output is then passed to the html template and sent to the client as the final HTML along with react bundles.&lt;/p&gt;
&lt;p&gt;One advantage of using server-side rendering with React and Express is that it allows us to generate the initial HTML on the server, which can improve the initial load time for the application. This can be especially beneficial for applications that have a lot of dynamic content, or for users with slower internet connections.&lt;/p&gt;
&lt;p&gt;Another advantage is that it can improve the SEO of the application. Search engines, such as Google, are able to crawl and index the initial HTML of the page, which can make it easier for users to find the application in search results.&lt;/p&gt;
&lt;p&gt;In summary, using server-side rendering with React and Express can improve the performance and SEO of your JavaScript applications. It allows you to generate the initial HTML on the server, which can improve the initial load time and make it easier for search engines to crawl and index the page.&lt;/p&gt;
&lt;h5&gt;Rendering React Component&lt;/h5&gt;
&lt;p&gt;&lt;code&gt;renderToString&lt;/code&gt; and &lt;code&gt;renderToStream&lt;/code&gt; are both methods used in React to render a React component to a string or stream, respectively.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;renderToString&lt;/code&gt; is used to render a React component to a static HTML string, which can be used for server-side rendering. This method is synchronous and returns the resulting HTML string.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;renderToStream&lt;/code&gt; is used to render a React component to a stream, which allows for streaming the resulting HTML to the client. This method is asynchronous and returns a Readable stream.&lt;/p&gt;
&lt;p&gt;Both methods can be useful for optimizing the performance of a React application by rendering the initial HTML on the server-side and streaming it to the client. However, &lt;code&gt;renderToStream&lt;/code&gt; is more suitable for large applications with a lot of data, as it allows for streaming the data in chunks to the client instead of sending it all at once.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/iamvishal345/ps_spacex_coding_assignment&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/iamvishal345/lit-element-initial_setup?label=Fork%20Complete%20Project&amp;amp;style=social&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Create TODO Application using Vanilla JS and Redux!]]></title><description><![CDATA[In this blog, I am going to show you how to create a simple todo application using vanilla JavaScript and Redux. This is a great way to learn the basics of Redux and how to use it in a practical way.]]></description><link>https://codeentity.tech/todo-vanilla-redux/</link><guid isPermaLink="false">https://codeentity.tech/todo-vanilla-redux/</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Redux]]></category><category><![CDATA[Projects]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sat, 17 Oct 2020 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;In this blog, I am going to show you how to create a simple todo application using vanilla JavaScript and Redux. This is a great way to learn the basics of Redux and how to use it in a practical way.&lt;/p&gt;
&lt;h5&gt;Before Staring&lt;/h5&gt;
&lt;p&gt;Before we begin, let’s go over some key concepts and terms that will be used throughout this tutorial:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Actions&lt;/strong&gt;: An action is a plain javascript object that describes a change in the application’s state. It typically contains a type property that describes the type of action and any additional data that may be needed to make the change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reducers&lt;/strong&gt;: A reducer is a pure function that takes in the current state and an action, and returns a new state based on the action. It is responsible for updating the state of the application based on the actions it receives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Store&lt;/strong&gt;: The store is the central repository for all of the application’s state. It is created by passing the root reducer to the createStore() method provided by redux.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dispatch&lt;/strong&gt;: Dispatching an action is the process of sending an action to the store so that it can be handled by the reducers and the state can be updated.&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Getting Started&lt;/h5&gt;
&lt;p&gt;First we will generate a vanilla js project using &lt;a href=&quot;https://vitejs.dev/guide/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;vite&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;npm create vite@latest todo-app&lt;/code&gt; and select &lt;code&gt;Vanilla&lt;/code&gt; as Framework.&lt;/p&gt;
&lt;p&gt;Next, we need to install the Redux library. We can do this by running the following command in our terminal:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install redux --save&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Next, we need to create our Redux store. The store holds the state of our application and allows us to dispatch actions that change the state.&lt;/p&gt;
&lt;p&gt;Create a file with name &lt;code&gt;store.js&lt;/code&gt; and add following code in it.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// store.js&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;createStore&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;redux&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Our initial state&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;initialState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  todoArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; []&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Our reducer&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reducer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;initialState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;ADD_TODO&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Add a new todo to the list&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        todoArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todoArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;payload&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;REMOVE_TODO&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Remove a todo from the list&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        todoArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todoArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!==&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;payload&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Create our store&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createStore&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;reducer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the code above, we have defined our initial state and our reducer. The reducer takes the current state and an action, and returns a new state based on the action. In our case, we have two actions: &lt;strong&gt;ADD_TODO&lt;/strong&gt; and &lt;strong&gt;REMOVE_TODO&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now, let’s create our HTML page and add some basic styles.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;html&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;&amp;lt;!-- index.html --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;DOCTYPE&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;en&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;UTF-8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;X-UA-Compatible&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;IE=edge&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;meta&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;viewport&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;width=device-width, initial-scale=1.0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;Todo App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;Todo List&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;form-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;Title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;input&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Pickup Groceries&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;          /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;form-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;Summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;textarea&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;placeholder&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Don&amp;#39;t forgat to add milk and eggs&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;          &amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;textarea&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;Add Task&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-7&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/main.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In code above we have created a basic form and a app container for todo list.&lt;/p&gt;
&lt;p&gt;Now let’s add the logic to add items to our todo list.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// index.js&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./style.css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;// Get the app container&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;preventDefault&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;formData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;FormData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dataObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;formData&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dataObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dataObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dispatch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;ADD_TODO&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    payload&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dataObj&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;generateTodoList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todoArr&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;#app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;listEl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;ol&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;listEl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;classList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;todo-list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;listEl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;preventDefault&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dataset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;toUpperCase&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;dataset&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dispatch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;_TODO&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    payload&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;generateTodoList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;htmlList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;li class=&amp;quot;todo-list-item&amp;quot; &amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;complete&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;div class=&amp;quot;checkmark&amp;quot;&amp;gt;&amp;amp;#10004;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;button data-action=&amp;quot;complete&amp;quot; data-index=&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;quot; title=&amp;quot;Complete Task&amp;quot; class=&amp;quot;remove-button&amp;quot;&amp;gt;&amp;amp;#10004;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;div class=&amp;quot;todo-item&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          &amp;lt;p class=&amp;quot;todo-title&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;p class=&amp;quot;todo-summary&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;quot;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;button data-action=&amp;quot;remove&amp;quot; data-index=&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;quot; title=&amp;quot;Remove Task&amp;quot; class=&amp;quot;remove-button&amp;quot;&amp;gt;&amp;amp;#9747;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;listEl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;innerHTML&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;htmlList&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;listEl&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In code above we have added an event listener for form submit event. Where we are extracting data from the form and dispatching an event &lt;strong&gt;ADD_TODO&lt;/strong&gt; to update store.&lt;/p&gt;
&lt;p&gt;Then we are subscribing to store changes so that we can update todo list whenever store updates.&lt;/p&gt;
&lt;p&gt;At last we have created a basic template to render todo item and added an event listener to mark Item as complete or Remove the Item.&lt;/p&gt;
&lt;p&gt;Then we will add some css to style the app.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;css&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt;Inter&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; Avenir&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Helvetica&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;Arial&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-1&quot;&gt;color-scheme&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt;light dark&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.87&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;1a202c&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-synthesis&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;text-rendering&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;optimizeLegibility&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-webkit-font-smoothing&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;antialiased&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-moz-osx-font-smoothing&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;grayscale&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;-webkit-text-size-adjust&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;em&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1.1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;transparent&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.6&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;em&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;em&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;em&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;inherit&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;0c6c33&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;transition&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt;background-color &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;179848&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;focus&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;focus-visible&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;outline&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;-webkit-focus-ring-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-10&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;media&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;prefers-color-scheme&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; light&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;1a202c&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;ffffff&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;f9f9f9&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo-item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;1a202c&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.87&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;form-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1.25&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.75&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;textarea&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.75&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo-list&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;list-style&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo-list-item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;self-start&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;gap&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.87&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo-item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;1a202c&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo-title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1.5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;todo-summary&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;remove-button&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-4&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;checkmark&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-5&quot;&gt;0c6c33&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That’s it. We have created a todo app in Vanilla JS using redux.
Next you can add some logic to update a task or store tasks in localstorage for persistance.&lt;/p&gt;
&lt;p&gt;Thanks &amp;#x26; Keep Coding.&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-11 { color: #8190A0; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Setting Up Redux in Vanilla JS!]]></title><description><![CDATA[Redux is a powerful state management tool for JavaScript applications, allowing developers to manage and maintain application state in a predictable and efficient manner. In this blog, we will go over the steps to set up Redux in a vanilla JavaScript application.]]></description><link>https://codeentity.tech/redux-vanilla-js/</link><guid isPermaLink="false">https://codeentity.tech/redux-vanilla-js/</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Redux]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Tue, 13 Oct 2020 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Redux&lt;/strong&gt; is a powerful state management tool for JavaScript applications, allowing developers to manage and maintain application state in a predictable and efficient manner. In this blog, we will go over the steps to set up Redux in a vanilla JavaScript application.&lt;/p&gt;
&lt;p&gt;First we will generate a vanilla js project using &lt;a href=&quot;https://vitejs.dev/guide/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;vite&lt;/a&gt;.&lt;/p&gt;
&lt;h5&gt;Getting Started&lt;/h5&gt;
&lt;p&gt;First, we need to install the Redux library. We can do this by running the following command in our terminal:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm install redux --save&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Next, we need to create a store for our application state. The store is the central location where all of our application data is stored and managed. We can create a store by importing the createStore method from the Redux library and passing it our reducer function.&lt;/p&gt;
&lt;p&gt;Create a file with name &lt;code&gt;store.js&lt;/code&gt; and add following code in it.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;createStore&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;redux&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;createStore&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;reducer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The reducer function is responsible for updating the state based on the action that is dispatched. It is a pure function that takes in the current state and an action, and returns the next state.&lt;/p&gt;
&lt;p&gt;Create a file with name &lt;code&gt;reducer.js&lt;/code&gt; and add following code.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;reducer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;ADD_ITEM&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        items&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;state&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Import this reducer function in &lt;code&gt;store.js&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;Now that we have our store and reducer set up, we can start dispatching actions to update the state. We can dispatch an action by calling the dispatch method on the store, passing in the action object.&lt;/p&gt;
&lt;p&gt;Import &lt;code&gt;store&lt;/code&gt; from &lt;code&gt;store.js&lt;/code&gt; in index.js file and add following code.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;dispatch&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;ADD_ITEM&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  item&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    id&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;item1&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also subscribe to the store to be notified of any state changes. This is useful for updating our UI whenever the state is updated. We can subscribe by calling the &lt;code&gt;subscribe&lt;/code&gt; method on the store and passing in a callback function.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;())&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, we can access the current state of the store by calling the &lt;code&gt;getState&lt;/code&gt; method on the store. This is useful for getting the current state to render in our UI or for performing calculations.&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;currentState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;getState&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Adding Routing to Lit Element!]]></title><description><![CDATA[Routing in Single Page Application is done internally using Browser History API. In this article we are going to add Routing to our application and restructure the project.]]></description><link>https://codeentity.tech/routing-lit-element/</link><guid isPermaLink="false">https://codeentity.tech/routing-lit-element/</guid><category><![CDATA[JS Frameworks]]></category><category><![CDATA[Lit Element]]></category><category><![CDATA[Web Components]]></category><category><![CDATA[SPA Routing]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Sat, 26 Sep 2020 07:47:58 GMT</pubDate><content:encoded>&lt;p&gt;Now let’s add routing to our project.&lt;/p&gt;
&lt;p&gt;For this we will use &lt;code&gt;lit-element-router&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;npm install lit-element-router&lt;/code&gt; in console&lt;/p&gt;
&lt;p&gt;Now let’s start restructuring our project&lt;/p&gt;
&lt;p&gt;We will separate pages and components for better understanding&lt;/p&gt;
&lt;p&gt;Create Project files as given in following image:
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 558px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/a7fdddfe94de626a3ca837874373c252/bb41d/directory.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 93.67088607594937%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAATABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAIBBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHlxWIBUAC//8QAFxAAAwEAAAAAAAAAAAAAAAAAARBBMf/aAAgBAQABBQKKI4v/xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAECAQE/AR//xAAUEAEAAAAAAAAAAAAAAAAAAAAw/9oACAEBAAY/Ah//xAAaEAACAgMAAAAAAAAAAAAAAAAAgQEQIDFR/9oACAEBAAE/Id0ZMdDHgf/aAAwDAQACAAMAAAAQbDd8/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAEREP/aAAgBAwEBPxClQs//xAAXEQADAQAAAAAAAAAAAAAAAAAAAREQ/9oACAECAQE/EIyMWf/EAB8QAAIBAwUBAAAAAAAAAAAAAAABESFhkRAxQVFx8f/aAAgBAQABPxBpoq/CCX9FA4bdkWZIsyIovmmv/9k=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;alt text&quot;
        title=&quot;Logo Title Text 1&quot;
        src=&quot;/static/a7fdddfe94de626a3ca837874373c252/bb41d/directory.jpg&quot;
        srcset=&quot;/static/a7fdddfe94de626a3ca837874373c252/ff44c/directory.jpg 158w,
/static/a7fdddfe94de626a3ca837874373c252/a6688/directory.jpg 315w,
/static/a7fdddfe94de626a3ca837874373c252/bb41d/directory.jpg 558w&quot;
        sizes=&quot;(max-width: 558px) 100vw, 558px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now replace code of &lt;em&gt;App.js&lt;/em&gt; file with code given below&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element-router&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//Components&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./components/navigation/nav-link.component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./components/header/header.component&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./router-outlet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-3 grvsc-tZ0ymb-i grvsc-th1M5T-3&quot;&gt;//pages&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./pages/home/home.page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./pages/contact/contact.page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./pages/about/about.page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      route&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      query&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;routes&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        pattern&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; title&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;Home&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;about&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        pattern&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;about&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;contact&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        pattern&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;contact&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        name&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;not-found&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        pattern&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;app-header&amp;gt;&amp;lt;/app-header&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;nav-link href=&amp;quot;/&amp;quot;&amp;gt;Home&amp;lt;/nav-link&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;nav-link href=&amp;quot;/contact&amp;quot;&amp;gt;Contact&amp;lt;/nav-link&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;nav-link href=&amp;quot;/about&amp;quot;&amp;gt;About&amp;lt;/nav-link&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;router-outlet active-route=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;home-page route=&amp;quot;home&amp;quot;&amp;gt;&amp;lt;/home-page&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;about-page route=&amp;quot;about&amp;quot;&amp;gt;&amp;lt;/about-page&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;contact-page route=&amp;quot;contact&amp;quot;&amp;gt;&amp;lt;/contact-page&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;h1 route=&amp;quot;not-found&amp;quot;&amp;gt;Not Found&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;/router-outlet&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;app-container&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now add below code to &lt;em&gt;router-outlet.js&lt;/em&gt; file&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;outlet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element-router&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;RouterOutlet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;outlet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; &amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;router-outlet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;RouterOutlet&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Router outlet will act as a container for the page to which we will switch.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Slot&lt;/strong&gt; is used to render the children of the element. A children is something written between opening and closing tag of element.&lt;/p&gt;
&lt;p&gt;Now add following code to &lt;em&gt;nav-link.component.js&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;navigator&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element-router&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;NavLink&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;navigator&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;a href=&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;quot; @click=&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;handleClick&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;handleClick&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-4&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;preventDefault&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;navigate&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;NavLink&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let’s add some basic styling to our nav-bar&lt;/p&gt;
&lt;p&gt;Wrap nav-links in &lt;em&gt;App.js&lt;/em&gt; in div with class nav-container&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;nav-container&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Home&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/contact&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;Contact&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;/about&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-19 grvsc-th1M5T-7&quot;&gt;About&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add styling to &lt;em&gt;App.styles.js&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;css&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;nav-container&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-8&quot;&gt;justify-content&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-4&quot;&gt;space-evenly&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Import styles to &lt;em&gt;App.js&lt;/em&gt; and add to return array of &lt;em&gt;styles()&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Add following code to &lt;em&gt;nav-link.styles.js&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;NavLinkStyles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  .nav-link {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    text-decoration: none;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    border: solid 2px black;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    color: black;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    padding: 5px;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    margin-right: 5px;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    border-radius: 5px;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    display: inline-block;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    text-align: center;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  slot {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    font-weight: bold;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  .nav-link:hover {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    color: #ffffff;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    background-color: #000000;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Import styles to &lt;em&gt;nav-link.js&lt;/em&gt; and add to &lt;em&gt;styles()&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Add &lt;em&gt;nav-link&lt;/em&gt; class to &lt;code&gt;&amp;#x3C;a&gt;&lt;/code&gt; tag&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-7&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;nav-link&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-11 grvsc-tZ0ymb-i grvsc-th1M5T-7&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;${this.href}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-8 grvsc-th1M5T-1&quot;&gt;@click=&amp;quot;${this.handleClick}&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-20 grvsc-th1M5T-7&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-8 grvsc-th1M5T-1&quot;&gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-8 grvsc-th1M5T-1&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Wolaaa! We have a beautiful Nav Bar now.&lt;/p&gt;
&lt;p&gt;Now let’s add some code to pages.&lt;/p&gt;
&lt;p&gt;Add some placeholder code to all pages&lt;/p&gt;
&lt;p&gt;&lt;em&gt;about.page.js&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;About&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-6&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;styles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;``&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; &amp;lt;div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;h1&amp;gt;This is About Page&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      eg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;about-page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;About&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;contact.page.js&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;8&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Contact&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-6&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;styles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;``&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; &amp;lt;div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;h1&amp;gt;This is Contact Page&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      eg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;contact-page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Contact&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;home.page.js&lt;/em&gt;&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;9&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Home&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-6&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;styles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;``&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; &amp;lt;div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;h1&amp;gt;This is Home Page&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      eg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;home-page&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Home&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now spin up the server by typing &lt;code&gt;npm start&lt;/code&gt; in console&lt;/p&gt;
&lt;p&gt;And try to switch pages by clicking on nav links.&lt;/p&gt;
&lt;p&gt;You will notice that as you switch between pages, Url in browser address bar also change.&lt;/p&gt;
&lt;p&gt;The is handled by &lt;em&gt;lit-element-router&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Now go to a specific route other then ”/” and refresh the page&lt;/p&gt;
&lt;p&gt;You will get &lt;code&gt;Cannot GET /contact&lt;/code&gt; in browse.&lt;/p&gt;
&lt;p&gt;This is because these routes are generated within our app dynamically and they don’t exist till our app loads.&lt;/p&gt;
&lt;p&gt;But Since we refreshed the page webpack-dev-server will try to find index.html in route that don’t exist and we will get this error.&lt;/p&gt;
&lt;p&gt;To fix the we will add a property to dev config file&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;10&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;devServer&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    historyApiFallback&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Restart the Server. Now you will see the app will work as intended.&lt;/p&gt;
&lt;p&gt;Now whenever webpack detects that given address does not match to any file, it will simply serve the base index file and after that internal router will routes to page specified in URL.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/iamvishal345/lit-element-initial_setup&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/iamvishal345/lit-element-initial_setup?label=Fork%20Complete%20Project&amp;amp;style=social&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-i { font-style: italic; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-3 { color: #AAAAAA; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-tZ0ymb-20 { color: #91B3E0; }
  .quiet-light .grvsc-tZ0ymb-11 { color: #8190A0; }
  .quiet-light .grvsc-tZ0ymb-19 { color: #333333FF; }
  .quiet-light .grvsc-tZ0ymb-8 { color: #660000; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-3 { color: #7285B7; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[Setting Up Lit Element Project!]]></title><description><![CDATA[Lit Element is a simple library for creating fast, lightweight web components that work in any web page with any framework. In this article we are going to setup a Lit Element project using webpack.]]></description><link>https://codeentity.tech/lit-element/</link><guid isPermaLink="false">https://codeentity.tech/lit-element/</guid><category><![CDATA[JS Frameworks]]></category><category><![CDATA[Lit Element]]></category><category><![CDATA[Web Components]]></category><dc:creator><![CDATA[Vishal Sharma]]></dc:creator><pubDate>Fri, 25 Sep 2020 12:11:44 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Lit Element&lt;/strong&gt; is a simple library for creating fast, lightweight web components that work in any web page with any framework.&lt;/p&gt;
&lt;p&gt;LitElement uses &lt;em&gt;lit-html&lt;/em&gt; to render into &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Shadow DOM&lt;/a&gt; , and adds API to manage properties and attributes. Properties are observed by default, and elements update asynchronously when their properties change.&lt;/p&gt;
&lt;h5&gt;Getting Started&lt;/h5&gt;
&lt;p&gt;Create a Project Folder and Open it in VS code.&lt;/p&gt;
&lt;p&gt;Open console in project directory.&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;npm init&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Enter Project name and press enter enter enter …&lt;/p&gt;
&lt;p&gt;This will create a &lt;em&gt;Package.json&lt;/em&gt; file.&lt;/p&gt;
&lt;p&gt;Now We need to install some npm packages.&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;npm install lit-element&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;We will use webpack to bundle our project.&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;npm install webpack webpack-cli html-webpack-plugin clean-webpack-plugin webpack-dev-server --save-dev&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now we will start creating app components&lt;/p&gt;
&lt;p&gt;Create &lt;em&gt;src&lt;/em&gt; folder and create &lt;em&gt;App.js&lt;/em&gt; file inside it.
Copy below code in &lt;em&gt;App.js&lt;/em&gt; file&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-6&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;styles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;``&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;div&amp;gt;Loading Application Component Successfully&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;app-container&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now Create another file &lt;em&gt;header.js&lt;/em&gt; and copy below code&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;Header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-6&quot;&gt;LitElement&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;styles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;``&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt; &amp;lt;div&amp;gt;This is a header in shadow dom&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      eg&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;        type&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-7&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;customElements&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;app-header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;Header&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Import &lt;em&gt;app-header&lt;/em&gt; into &lt;em&gt;App.js&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;import ./header.js&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now inject header component App&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;&amp;#x3C;app-header&gt;&amp;#x3C;/app-header&gt;&lt;/code&gt; in render function&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;app-header&amp;gt;&amp;lt;/app-header&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;div&amp;gt;Loading Successfully&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now create two files in base directory of your project&lt;/p&gt;
&lt;p&gt;&lt;em&gt;webpack.dev.js&lt;/em&gt; , &lt;em&gt;webpack.prod.js&lt;/em&gt; and copy below code respectively&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;html-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;CleanWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;clean-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  mode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;development&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  entry&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    index&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./src/App.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  devtool&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;inline-source-map&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  plugins&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;CleanWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; cleanStaleWebpackAssets&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-5 grvsc-th1M5T-4&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      template&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;CleanWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;clean-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;html-webpack-plugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-8&quot;&gt;exports&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  mode&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;production&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  entry&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    app&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./src/App.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  plugins&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;CleanWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-tZ0ymb-b grvsc-th1M5T-8&quot;&gt;HtmlWebpackPlugin&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;      template&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;./index.html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  ]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  output&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    filename&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;[name].bundle.js&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-9&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;resolve&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-1&quot;&gt;__dirname&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;dist&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add following scripts to &lt;em&gt;package.json&lt;/em&gt; file&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&quot;start&quot;: &quot;webpack-dev-server --hot --inline --config webpack.dev.js&quot;,&lt;/code&gt;
&lt;code&gt;&quot;build&quot;: &quot;webpack --config webpack.prod.js&quot;,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now type &lt;code&gt;npm start&lt;/code&gt; in console.&lt;/p&gt;
&lt;p&gt;This will start dev server and by default will run on port 8080&lt;/p&gt;
&lt;p&gt;Now lets add some css to our project&lt;/p&gt;
&lt;p&gt;Create &lt;em&gt;App.styles.js&lt;/em&gt; file in src folder and copy following code&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;lit-element&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-10&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;AppStyles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  .app-container {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    border: solid 2px black;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  h1 {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    text-align: center;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  .app-body {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    text-align: justify;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Import this file to &lt;em&gt;App.js&lt;/em&gt;
&lt;code&gt;import { AppStyles } from &quot;./App.styles&quot;;&lt;/code&gt;
and add this to styles array&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;6&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;styles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;``&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-7 grvsc-th1M5T-7&quot;&gt;AppStyles&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add made some changes to html of app js&lt;/p&gt;
&lt;pre class=&quot;grvsc-container quiet-light grvsc-ps-th1M5T&quot; data-language=&quot;javascript&quot; data-index=&quot;7&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-10 grvsc-th1M5T-10&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-9 grvsc-tZ0ymb-b grvsc-th1M5T-9&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;div class=&amp;quot;app-container&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;app-header&amp;gt;&amp;lt;/app-header&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;h1 class=&amp;quot;app-title&amp;quot;&amp;gt;App title&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;p class=&amp;quot;app-body&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          Lorem ipsum dolor, sit amet consectetur adipisicing elit. Magnam&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          numquam in ipsa optio cumque architecto quisquam, at repellendus&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          facere iusto consequatur animi inventore possimus quas, sint sunt&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;          quidem maxime libero?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;        &amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;      &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-4 grvsc-th1M5T-6&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-6&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;grvsc-tZ0ymb-1 grvsc-th1M5T-1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;grvsc-tZ0ymb-6 grvsc-th1M5T-1&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now if you see in browser you will notice that styles of &lt;code&gt;App&lt;/code&gt; component will not effect &lt;code&gt;app-header&lt;/code&gt; component.
This is because &lt;code&gt;app-header&lt;/code&gt; is attached to Shadow DOM of &lt;code&gt;App&lt;/code&gt; and thus styles will not pass to it.&lt;/p&gt;
&lt;p&gt;This is great for creating reusable independent components which we can directly plug to any part of our application without worrying about styles conflicting with other components.&lt;/p&gt;
&lt;p&gt;Finally we have a working lit element project.&lt;/p&gt;
&lt;p&gt;In next part we will restructure our project and add routing on it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/iamvishal345/lit-element-initial_setup&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://img.shields.io/github/forks/iamvishal345/lit-element-initial_setup?label=Fork%20Complete%20Project&amp;amp;style=social&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .quiet-light { background-color: #F5F5F5; }
  .quiet-light .grvsc-tZ0ymb-b { font-weight: bold; }
  .quiet-light .grvsc-tZ0ymb-10 { color: #4B69C6; }
  .quiet-light .grvsc-tZ0ymb-1 { color: #333333; }
  .quiet-light .grvsc-tZ0ymb-6 { color: #777777; }
  .quiet-light .grvsc-tZ0ymb-7 { color: #7A3E9D; }
  .quiet-light .grvsc-tZ0ymb-4 { color: #448C27; }
  .quiet-light .grvsc-tZ0ymb-9 { color: #AA3731; }
  .quiet-light .grvsc-tZ0ymb-5 { color: #9C5D27; }
  .quiet-light .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(0, 0, 0, 0.05));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(0, 0, 0, 0.2));
  }
  body.dark-theme .grvsc-ps-th1M5T {
    background-color: #002451;
    color: #ffffff;
  }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-10 { color: #EBBBFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-1 { color: #FFFFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-7 { color: #FF9DA4; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-6 { color: #D1F1A9; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-8 { color: #FFEEAD; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-9 { color: #BBDAFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-5 { color: #99FFFF; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-th1M5T-4 { color: #FFC58F; }
  body.dark-theme .grvsc-ps-th1M5T .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item></channel></rss>