<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Geetansh Chahal</title>
    <description>The latest articles on DEV Community by Geetansh Chahal (@geetanshchahal).</description>
    <link>https://dev.to/geetanshchahal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2741502%2Fce0e342a-743d-4205-a633-e1481b084e9d.JPG</url>
      <title>DEV Community: Geetansh Chahal</title>
      <link>https://dev.to/geetanshchahal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/geetanshchahal"/>
    <language>en</language>
    <item>
      <title>React: Unveiling the Story Behind Its Name and Iconic Logo!</title>
      <dc:creator>Geetansh Chahal</dc:creator>
      <pubDate>Thu, 30 Jan 2025 18:39:03 +0000</pubDate>
      <link>https://dev.to/geetanshchahal/react-unveiling-the-story-behind-its-name-and-iconic-logo-56ho</link>
      <guid>https://dev.to/geetanshchahal/react-unveiling-the-story-behind-its-name-and-iconic-logo-56ho</guid>
      <description>&lt;p&gt;The React name and logo—so sleek, so vibrant—have an interesting story that blends creativity with a touch of scientific inspiration! React, the popular JavaScript library for building user interfaces, is celebrated for its simple yet powerful design. But have you ever wondered about the glowing atomic symbol in its logo? Or the story behind its name?🧐&lt;/p&gt;

&lt;p&gt;It all began in 2013 when React was created by &lt;em&gt;Jordan Walke&lt;/em&gt; and his team at Facebook. The goal was to make UI development easier and more efficient, especially as web applications became increasingly complex. The logo and name, however, wasn't just a random thing. It was crafted to symbolize the core of React itself.🚀&lt;/p&gt;

&lt;p&gt;At that time, Facebook's front-end team was developing a sophisticated UI, namely &lt;strong&gt;Bolt.js&lt;/strong&gt;🔩, a client-side MVC framework. This framework integrated various JavaScript tools to manage the intricate interactions required for features like the Facebook timeline, chat, news feed, and other advanced applications.&lt;/p&gt;

&lt;p&gt;This was around the time when Facebook acquired Instagram. &lt;em&gt;Jordan Walke&lt;/em&gt;, who was working on Ads, came up with an interesting idea to transform Bolt by making it more functional—removing the MVC architecture and introducing the concept of re-rendering. Initially named &lt;strong&gt;FBolt&lt;/strong&gt; ⚙️ (Functional Bolt), it later evolved with the addition of JSX syntax and state management based on the Flux architecture, and was renamed &lt;strong&gt;React&lt;/strong&gt;. The new name reflected the library’s philosophy: breaking down complexity into clean and reusable smaller units.&lt;/p&gt;

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

&lt;p&gt;The night before making it open source, a designer named &lt;em&gt;Michael&lt;/em&gt;, who was working at Instagram, designed the iconic &lt;strong&gt;React logo&lt;/strong&gt;.  The design resembles an atom, and if you look closely at the empty cutout in the center of the logo, you'll see a top view of a bolt.&lt;/p&gt;

&lt;p&gt;If you like the post, React⚛️ to it and share your views.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Short-Circuit Evaluation in JavaScript: Boost Performance and Simplify Logic!</title>
      <dc:creator>Geetansh Chahal</dc:creator>
      <pubDate>Sat, 25 Jan 2025 06:13:22 +0000</pubDate>
      <link>https://dev.to/geetanshchahal/short-circuit-evaluation-in-javascript-boost-performance-and-simplify-logic-4m79</link>
      <guid>https://dev.to/geetanshchahal/short-circuit-evaluation-in-javascript-boost-performance-and-simplify-logic-4m79</guid>
      <description>&lt;p&gt;Have you ever wondered how &lt;strong&gt;??&lt;/strong&gt;, &lt;strong&gt;||&lt;/strong&gt;, and &lt;strong&gt;&amp;amp;&amp;amp;&lt;/strong&gt; work internally to determine the result they return? Is the result always correct? What’s the difference between them? No worries, buddy—let’s break it down and solve this peculiar mystery!🧐&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Short-circuit evaluation&lt;/em&gt;&lt;/strong&gt; in JavaScript refers to a programming concept where logical operators evaluate expressions from left to right and stop as soon as the result is determined.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Logical AND (&amp;amp;&amp;amp;):
&lt;/h2&gt;

&lt;p&gt;It returns the first falsy value it encounters or the last value if all are truthy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 5;
let y = 0;

console.log(x &amp;amp;&amp;amp; y);  // 0
console.log(x &amp;amp;&amp;amp; true);  // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Logical OR (||):
&lt;/h2&gt;

&lt;p&gt;It returns the first truthy value it encounters or the last value if all are falsy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = null;
let b = "Hello";

console.log(a || b);  // Hello
console.log(a || false);  //false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Nullish Coalescing Operator (??):
&lt;/h2&gt;

&lt;p&gt;It’s used to provide a default value only when the left-hand operand is null or undefined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let userName = null;
let result = 0 ?? 100;

console.log(result);  // 0
console.log(userName ?? "Guest")  // Guest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Combined Usage:
&lt;/h2&gt;

&lt;p&gt;We can use them together as well, but it is recommended to use parentheses to avoid confusion and undesired results.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = null;
let b = 0;
let c = 10;
let d= 20

let result = (a ?? b) || (c &amp;amp;&amp;amp; d);
console.log(result);  // 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(a ?? b) → (null ?? 0) → 0 //since left is null&lt;br&gt;
(c &amp;amp;&amp;amp; d) → (10 &amp;amp;&amp;amp; 20) → 20 //since left is truthy&lt;br&gt;
(a ?? b) || (c &amp;amp;&amp;amp; d) → ( 0 || 20) → 20  //since left is falsy&lt;/p&gt;

&lt;h2&gt;
  
  
  Merits:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Optimizes performance by skipping unnecessary evaluations.&lt;/li&gt;
&lt;li&gt;Make the code cleaner and more readable.&lt;/li&gt;
&lt;li&gt;Prevent runtime errors by avoiding operations on &lt;strong&gt;null&lt;/strong&gt; or &lt;strong&gt;undefined&lt;/strong&gt; values.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demerits:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If a condition fails, it can be challenging to identify the issue during debugging.&lt;/li&gt;
&lt;li&gt;Can confuse readers about the intent.&lt;/li&gt;
&lt;li&gt;Can lead to unintended results&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use it for simple logic.&lt;/li&gt;
&lt;li&gt;Add comments to improve understanding of the logic for other coders.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;??&lt;/strong&gt; instead of &lt;strong&gt;||&lt;/strong&gt; when dealing with null or undefined values to avoid overriding falsy values like &lt;strong&gt;0&lt;/strong&gt; or &lt;strong&gt;""&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Short-circuit evaluation is not limited to JavaScript; it is widely used in many programming languages such as Python, Java, C/C++, Kotlin, Go, Swift, and more. However, the symbols and usage can vary slightly depending on the language's syntax and conventions.&lt;/p&gt;

&lt;p&gt;If you like the post, react to it and share your views.&lt;br&gt;
Connect on LinkedIn:- &lt;a href="http://www.linkedin.com/in/geetansh-chahal-b7473b1b4/" rel="noopener noreferrer"&gt;www.linkedin.com/in/geetansh-chahal-b7473b1b4/&lt;/a&gt;&lt;/p&gt;

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