<?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: Sudhil Raj K</title>
    <description>The latest articles on DEV Community by Sudhil Raj K (@sudhil).</description>
    <link>https://dev.to/sudhil</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%2F1260905%2Fec09a3d9-ffbb-442d-abbf-104666d9507a.jpeg</url>
      <title>DEV Community: Sudhil Raj K</title>
      <link>https://dev.to/sudhil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sudhil"/>
    <language>en</language>
    <item>
      <title>⚡️Speed Up React Projects with Vite + SWC⚡️</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Wed, 09 Jul 2025 06:47:49 +0000</pubDate>
      <link>https://dev.to/sudhil/speed-up-react-projects-with-vite-swc-4a59</link>
      <guid>https://dev.to/sudhil/speed-up-react-projects-with-vite-swc-4a59</guid>
      <description>&lt;p&gt;React is awesome, no doubt. But let’s be real: long build times and sluggish refresh cycles can kill our momentum. That’s where Vite + SWC come in — a lightning combo that can give our React apps a serious speed boost in both development and build time.&lt;/p&gt;

&lt;p&gt;Let’s take a quick look at what makes this duo so cool 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  🔥 Meet Vite – The Blazing-Fast Dev Server
&lt;/h2&gt;

&lt;p&gt;Vite (pronounced “veet”) is a super fast build tool created by Evan You (yes, the creator of Vue.js). But don’t worry — it works brilliantly with React too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here’s what makes Vite special:
&lt;/h3&gt;

&lt;p&gt;👉🏻 It uses native ES modules during development, so it skips the traditional bundling step.&lt;br&gt;
👉🏻 It gives us instant HMR (Hot Module Replacement) — our code changes show up immediately in the browser.&lt;br&gt;
👉🏻 It’s lightweight, modern, and easy to set up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt; &lt;span class="nx"&gt;vite&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;latest&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;react&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;
&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt;
&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boom 💥 We’re up and running in seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ Now Enter SWC – The Speedy Web Compiler
&lt;/h2&gt;

&lt;p&gt;SWC stands for Speedy Web Compiler, and the name is no joke.&lt;/p&gt;

&lt;p&gt;Built using Rust, SWC is a drop-in replacement for Babel — but way faster. In some cases, it's up to 10x faster than Babel. 🔥&lt;/p&gt;

&lt;h3&gt;
  
  
  Why SWC?
&lt;/h3&gt;

&lt;p&gt;👉🏻 It compiles modern JavaScript and TypeScript.&lt;br&gt;
👉🏻 It supports React JSX out of the box.&lt;br&gt;
👉🏻 It’s fast — really fast — thanks to Rust and multi-threading.&lt;br&gt;
👉🏻 Works beautifully with Vite as a plugin.&lt;/p&gt;

&lt;p&gt;Think of SWC as a turbocharged Babel, built for today’s frontend demands.&lt;/p&gt;
&lt;h2&gt;
  
  
  🧩 Putting It Together: Vite + SWC in React
&lt;/h2&gt;

&lt;p&gt;Using them together means:&lt;/p&gt;

&lt;p&gt;Vite handles dev-time speed with instant reloads and fast startup.&lt;/p&gt;

&lt;p&gt;SWC compiles our code lightning-fast, reducing build time and improving performance.&lt;/p&gt;

&lt;p&gt;If we're using Vite’s official React template, SWC is already configured under the hood. But to be sure (or if customizing):&lt;/p&gt;

&lt;p&gt;Install the SWC plugin manually (optional advanced setup):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;D&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;vitejs&lt;/span&gt;&lt;span class="sr"&gt;/plugin-react-sw&lt;/span&gt;&lt;span class="err"&gt;c
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in our vite.config.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;react&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@vitejs/plugin-react-swc&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;react&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it. We’re now running one of the fastest React setups out there. 🔥&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Why It Matters
&lt;/h3&gt;

&lt;p&gt;We'll save time every time we hit "Save".&lt;/p&gt;

&lt;p&gt;Builds become blazingly fast, even in large projects.&lt;/p&gt;

&lt;p&gt;Our dev workflow becomes snappy and smooth — which is honestly just more fun! 😄&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up 🧵
&lt;/h2&gt;

&lt;p&gt;React is great — but pairing it with Vite and SWC makes it ridiculously fast. Whether we're working solo or on a big team, this combo can supercharge our dev experience without adding complexity.&lt;/p&gt;

&lt;p&gt;👉🏻 Vite makes development blazing fast with instant HMR.&lt;br&gt;
👉🏻 SWC is a faster replacement for Babel — built with Rust.&lt;/p&gt;

&lt;p&gt;Together, they make our React workflow smoother, leaner, and much faster.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>development</category>
    </item>
    <item>
      <title>Mystery of Function Currying in JavaScript!</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Sun, 15 Jun 2025 17:33:34 +0000</pubDate>
      <link>https://dev.to/sudhil/mystery-of-function-currying-in-javascript-54da</link>
      <guid>https://dev.to/sudhil/mystery-of-function-currying-in-javascript-54da</guid>
      <description>&lt;p&gt;Currying. Sounds fancy, right? Like something complicated you only use if you're building a giant functional programming library. But actually, it’s one of those little concepts in JavaScript that’s super useful and surprisingly fun once you get the hang of it!&lt;/p&gt;

&lt;p&gt;Let’s break it down the easy way. No scary jargon. Just real talk.&lt;/p&gt;

&lt;h2&gt;
  
  
  So What Is Currying? 🤔
&lt;/h2&gt;

&lt;p&gt;Normally, when you write a function, it looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Currying lets you break that down into smaller pieces — instead of giving all arguments at once, you feed them in one at a time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See what happened? add(2) gives you back a new function that’s waiting for b. When you give it 3, the magic happens!&lt;/p&gt;

&lt;p&gt;In simple words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Currying is transforming a function that takes multiple arguments into a series of functions that take one argument at a time.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Would Anyone Do That? 🤷‍♂️
&lt;/h2&gt;

&lt;p&gt;I had the same question. Like, why split up arguments like that?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s the deal:&lt;/strong&gt; currying gives you more control, especially when you want to reuse functions with some preset values.&lt;/p&gt;

&lt;p&gt;Example? Say you want to create a function that always doubles a number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 10&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// 20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of writing multiply(2, x) everywhere, you’ve got a neat double() function ready to go. Handy, right?&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Build a Curry Utility! 🛠
&lt;/h2&gt;

&lt;p&gt;Here’s how to make your own curry function that can handle multiple arguments step by step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;curry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;curried&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Got enough arguments, just run the function&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;nextArgs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;curried&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;nextArgs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Keep collecting&lt;/span&gt;
      &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now use it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;curriedSum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;curry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;curriedSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;     &lt;span class="c1"&gt;// 6&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;curriedSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;     &lt;span class="c1"&gt;// 6&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;curriedSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;     &lt;span class="c1"&gt;// 6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s flexible — and surprisingly elegant!&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Life Example You’ll Love ❤️
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sudhil&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Hello, Sudhil!&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Raj&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;   &lt;span class="c1"&gt;// Hello, Raj!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where currying shines. You’ve built a greeting factory 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait, Isn’t This Just Partial Application?
&lt;/h2&gt;

&lt;p&gt;Great question — they’re related, but not quite the same.&lt;/p&gt;

&lt;p&gt;Currying transforms a function into a series of functions that each take one argument.&lt;/p&gt;

&lt;p&gt;Partial application lets you pre-fill some arguments, and the result can still take multiple arguments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should I Start Currying Everything ❓
&lt;/h2&gt;

&lt;p&gt;Probably not. 😄&lt;/p&gt;

&lt;p&gt;Use currying when it makes your code cleaner or more reusable, not just to look cool. In team projects, it’s important that your teammates understand what’s going on too.&lt;/p&gt;

&lt;p&gt;That said, for utility functions, config-based behavior, or when you're building reusable patterns — currying is super helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping It Up 💡
&lt;/h2&gt;

&lt;p&gt;Currying might look a little weird at first, but once you try it out, you’ll see why it’s a favorite among JS developers who love clean, modular code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here's What You Should Remember 🧠
&lt;/h3&gt;

&lt;p&gt;Currying breaks a function into a chain of functions that take one argument each.&lt;/p&gt;

&lt;p&gt;It helps create reusable and customizable logic.&lt;/p&gt;

&lt;p&gt;You don’t need to use it everywhere — just where it makes sense.&lt;/p&gt;

&lt;p&gt;Thanks for reading 🙌&lt;br&gt;
Stay curious, and keep experimenting.&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Mystery of Hoisting in JavaScript!</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Thu, 26 Dec 2024 07:16:46 +0000</pubDate>
      <link>https://dev.to/sudhil/mystery-of-hoisting-in-javascript-7l2</link>
      <guid>https://dev.to/sudhil/mystery-of-hoisting-in-javascript-7l2</guid>
      <description>&lt;p&gt;JavaScript is full of quirks, and hoisting is one of those that tends to confuse newcomers. But don’t worry by the end of this post, you'll have a clear understanding of hoisting, simplified!&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Hoisting? 🤔
&lt;/h2&gt;

&lt;p&gt;At its core, hoisting is JavaScript's default behavior of moving declarations to the top of their scope. This doesn't mean the code is physically rearranged—it’s just how the JavaScript engine interprets it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Think of it this way:&lt;/strong&gt; before JavaScript starts executing your code, it "prepares" by allocating memory for all variables and functions upfront, even before a single line of code is executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Myths About Hoisting
&lt;/h2&gt;

&lt;p&gt;Only variables are hoisted.&lt;br&gt;
👎🏻 &lt;strong&gt;Not true&lt;/strong&gt;&lt;br&gt;
Both function declarations and variable declarations are hoisted.&lt;/p&gt;

&lt;p&gt;Hoisted variables are initialized automatically.&lt;br&gt;
👎🏻 &lt;strong&gt;Wrong again&lt;/strong&gt;&lt;br&gt;
Variables are hoisted but not initialized. Their value remains &lt;code&gt;undefined&lt;/code&gt; until explicitly assigned.&lt;/p&gt;
&lt;h2&gt;
  
  
  Understanding Hoisting with Examples 📚
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Variable Hoisting&lt;/strong&gt;&lt;br&gt;
Let’s start with variables declared using &lt;code&gt;var&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: undefined&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What happens here? JavaScript treats the code like this during execution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Declaration is hoisted&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Accesses the variable before initialization&lt;/span&gt;
&lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Initialization happens here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But with &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;, it’s a different story:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// ReferenceError: Cannot access 'name' before initialization&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sudhil&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables declared with &lt;code&gt;let&lt;/code&gt; or &lt;code&gt;const&lt;/code&gt; are hoisted, but they’re in a "&lt;strong&gt;temporal dead zone&lt;/strong&gt;" (TDZ) until their declaration is encountered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Function Hoisting&lt;/strong&gt;&lt;br&gt;
Function declarations are fully hoisted, both their name and body are available before the line of declaration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Output: "Hello!"&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, function expressions behave differently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;sayHi&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// TypeError: sayHi is not a function&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sayHi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hi!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the variable &lt;code&gt;sayHi&lt;/code&gt; is hoisted but not initialized until the assignment is reached.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Class Hoisting&lt;/strong&gt;&lt;br&gt;
Classes behave similarly to &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;. They are hoisted but cannot be accessed before their declaration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// ReferenceError: Cannot access 'MyClass' before initialization&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyClass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Classy!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Does Hoisting Matter? 🔥
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Predict Behavior&lt;/strong&gt;&lt;br&gt;
Understanding hoisting helps you predict how your code will run and avoid common pitfalls like using variables before they’re initialized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Clean Code&lt;/strong&gt;&lt;br&gt;
To avoid confusion, declare variables and functions at the top of their scope. This aligns with JavaScript's hoisting behavior and makes your code more readable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping It Up 💡
&lt;/h2&gt;

&lt;p&gt;Here’s What to Remember About Hoisting: 🧠&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Declarations (variables, functions, and classes) are hoisted; initializations are not.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;var&lt;/code&gt; declarations are hoisted with &lt;code&gt;undefined&lt;/code&gt;; &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; stay in the &lt;strong&gt;temporal dead zone&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Function declarations are fully hoisted, but function expressions are not.&lt;/li&gt;
&lt;li&gt;Hoisting helps the JavaScript engine understand your code, but understanding hoisting helps you write better code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading! 🙌&lt;br&gt;
Keep experimenting with JavaScript quirks, and stay tuned for more in this series.🚀&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Mystery of Closures in JavaScript!</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Sat, 23 Nov 2024 21:44:25 +0000</pubDate>
      <link>https://dev.to/sudhil/mystery-of-closures-in-javascript-3f10</link>
      <guid>https://dev.to/sudhil/mystery-of-closures-in-javascript-3f10</guid>
      <description>&lt;p&gt;At first glance, closures might seem like a complicated concept, but don’t worry they’re much simpler than they appear! Let’s strip away the confusion and address some common myths about closures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Myths About Closures
&lt;/h2&gt;

&lt;p&gt;Closures are special functions with access to their surrounding scope.&lt;br&gt;
👎🏻&lt;strong&gt;Not true&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A closure is not the same as a function.&lt;/li&gt;
&lt;li&gt;In JavaScript, every function inherently has access to the scope in which it was defined. This is just how functions work!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Closures require nested functions.&lt;br&gt;
👎🏻&lt;strong&gt;Wrong again&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nesting functions has nothing to do with creating closures.&lt;/li&gt;
&lt;li&gt;Whenever a function is created, it automatically forms a closure with its surrounding scope, no nesting required.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  What’s the Reality❓
&lt;/h2&gt;

&lt;p&gt;Closures are not some magical or unique feature. Instead, they’re just the combination of a function and the variables from the scope in which the function was created. Every function comes bundled with this context—think of it as a memory of where it came from.&lt;/p&gt;

&lt;p&gt;Here’s the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures" rel="noopener noreferrer"&gt;MDN&lt;/a&gt;-approved definition:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment).&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In plain English, a closure lets your function "remember" the variables from the place where it was created, even if it’s executed elsewhere.&lt;/p&gt;
&lt;h2&gt;
  
  
  Let’s See Closures in Action 🧑🏻‍💻
&lt;/h2&gt;

&lt;p&gt;Here’s a fun little example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createCounter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// This is the surrounding state&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// The inner function&lt;/span&gt;
        &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createCounter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Create a counter instance&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Output: 1&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Output: 2&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Output: 3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What’s Happening Here? 🤔&lt;br&gt;
When &lt;code&gt;createCounter&lt;/code&gt; is called, a variable &lt;code&gt;count&lt;/code&gt; is created inside its scope.&lt;br&gt;
The returned function remembers &lt;code&gt;count&lt;/code&gt;, even though &lt;code&gt;createCounter&lt;/code&gt; has already finished running.&lt;br&gt;
Each time &lt;code&gt;counter&lt;/code&gt; is called, it can access and update &lt;code&gt;count&lt;/code&gt; because of the closure.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Do Closures Matter? 🔥
&lt;/h2&gt;

&lt;p&gt;Closures aren't just a theoretical concept for acing interviews—they’re incredibly useful! Here are a few real-world scenarios:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Data Privacy
&lt;/h3&gt;

&lt;p&gt;Closures can keep variables private and inaccessible from the outside world.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;secretMessage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This is a secret!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Only this function can access the variable&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;secretMessage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Output: "This is a secret!"&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: message is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Event Handlers
&lt;/h3&gt;

&lt;p&gt;Closures are handy for event listeners when you want to "remember" some state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greetUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello, &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greetJohn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;greetUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;myButton&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;greetJohn&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Even after greetUser is done, greetJohn remembers "John"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Partial Application
&lt;/h3&gt;

&lt;p&gt;Closures let you pre-set arguments for a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// "a" is remembered&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Output: 10&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Output: 20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wait, Are Closures Perfect❓
&lt;/h2&gt;

&lt;p&gt;Not always! If you're not careful, closures can lead to memory leaks by keeping references to variables longer than necessary. For example, when closures are used inside loops, it’s easy to create unintended behaviors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 3, 3, 3&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fix this, you can use let (block scope) or an IIFE:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 0, 1, 2&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrapping It Up 🤲🏻💡
&lt;/h2&gt;

&lt;p&gt;Closures are everywhere in JavaScript. Whether you realize it or not, you’re already using them! They’re the secret sauce that makes JavaScript powerful and flexible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here’s What to Remember: 🧠
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Closures are not functions; they’re a function + the variables it remembers.&lt;/li&gt;
&lt;li&gt;Every function in JavaScript has a closure.&lt;/li&gt;
&lt;li&gt;Use closures for encapsulation, event handling, partial application, and more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading. 🙌&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Citizen Developers Rise Up: The LCNC Revolution 🌐</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Wed, 10 Apr 2024 20:25:29 +0000</pubDate>
      <link>https://dev.to/sudhil/citizen-developers-rise-up-the-lcnc-revolution-53il</link>
      <guid>https://dev.to/sudhil/citizen-developers-rise-up-the-lcnc-revolution-53il</guid>
      <description>&lt;p&gt;Remember the days when building software applications required a team of coding wizards, years of development time, and budgets that could rival Hollywood blockbusters? Well, those days are fading faster than a beta bug fix. Enter the &lt;strong&gt;low-code/no-code (LCNC) revolution&lt;/strong&gt;, a movement democratizing app creation and empowering a new generation of citizen developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is LCNC❓
&lt;/h2&gt;

&lt;p&gt;Think of LCNC platforms as user-friendly tools that bridge the gap between complex coding and drag-and-drop simplicity. Here's the breakdown:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Low-code:&lt;/strong&gt; These platforms provide a visual interface with pre-built components and functionalities. Developers (or citizen developers!) can customize these elements using some coding knowledge to create custom applications. &lt;br&gt;
Few examples are: Mendix, Microsoft Power Apps, Bubble, Appian, Webflow, and ActiveCampaign.&lt;br&gt;
&lt;strong&gt;No-code:&lt;/strong&gt; These platforms go even further, allowing users with little to no coding experience to build basic apps. They use an intuitive interface with drag-and-drop functionality and pre-built workflows.&lt;br&gt;
Few examples are: Zoho Creator, Caspio, Glide Apps, Adalo, Mailchimp, and Unbounce.&lt;/p&gt;

&lt;p&gt;The best platform depends on our specific needs, technical expertise, and budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is LCNC a Big Deal❓
&lt;/h2&gt;

&lt;p&gt;The benefits of LCNC are far-reaching:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Faster Development:&lt;/strong&gt; Businesses can bypass lengthy development cycles and get their ideas to market quicker.&lt;br&gt;
&lt;strong&gt;Democratization of App Creation:&lt;/strong&gt; Anyone with a good idea and basic digital skills can now build apps, not just professional coders.&lt;br&gt;
&lt;strong&gt;Increased Efficiency:&lt;/strong&gt; Streamline internal processes and build custom tools using LCNC instead of relying on expensive IT resources.&lt;br&gt;
&lt;strong&gt;Improved Collaboration:&lt;/strong&gt; Break down silos between business users and IT by empowering everyone to contribute to app development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Citizen Developers Take the Wheel 👨🏻‍💻
&lt;/h2&gt;

&lt;p&gt;LCNC platforms are empowering a new breed of developers: citizen developers. These are business users or individuals with limited coding knowledge who can now build basic applications that meet their specific needs. For example, a marketing team can use an LCNC platform to create a custom lead capture form without relying on the IT department.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Caveats❗
&lt;/h2&gt;

&lt;p&gt;While LCNC offers tremendous potential, it's not a silver bullet. Here are some limitations to consider:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complexity:&lt;/strong&gt; While user-friendly, LCNC platforms might not be suitable for building highly complex applications with unique functionalities.&lt;br&gt;
&lt;strong&gt;Customization:&lt;/strong&gt; The level of customization can be restricted compared to traditional coding.&lt;br&gt;
&lt;strong&gt;Vendor Lock-In:&lt;/strong&gt; Be aware of potential vendor lock-in, where you become reliant on a specific platform's features and functionalities.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Future of LCNC 🌐
&lt;/h2&gt;

&lt;p&gt;The LCNC market is booming, and it's expected to continue its rapid growth. As these platforms evolve, expect advancements in:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Artificial Intelligence (AI):&lt;/strong&gt; AI can further automate workflows and suggest functionalities, making LCNC even more accessible.&lt;br&gt;
&lt;strong&gt;Security and Scalability:&lt;/strong&gt; Security features and scalability will continue to improve, allowing LCNC to handle more complex applications.&lt;br&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; Expect smoother integration with existing enterprise systems and data sources.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line 🤔💡
&lt;/h2&gt;

&lt;p&gt;The LCNC revolution is empowering a new wave of creators and reshaping the software development landscape. While it won't replace traditional coding entirely, LCNC provides a powerful tool for businesses and individuals to turn their ideas into reality, faster and more efficiently than ever before.&lt;/p&gt;

&lt;p&gt;Thanks for reading. 🙌&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>development</category>
    </item>
    <item>
      <title>The Journey of CSS and SASS Towards Serenity</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Mon, 19 Feb 2024 15:23:34 +0000</pubDate>
      <link>https://dev.to/sudhil/the-journey-of-css-and-sass-towards-serenity-389f</link>
      <guid>https://dev.to/sudhil/the-journey-of-css-and-sass-towards-serenity-389f</guid>
      <description>&lt;p&gt;In the ever-changing world of web design, CSS has undergone significant advancements, enabling designers and developers to craft visually captivating websites. The evolution of CSS has been remarkable, transitioning from a simple styling language to a powerful toolset for creating visually appealing websites. Yet, as web projects became more complex, developers faced challenges in managing styles effectively. &lt;/p&gt;

&lt;p&gt;There comes preprocessors like &lt;strong&gt;SASS&lt;/strong&gt; (Syntactically Awesome Stylesheets) and its variant, &lt;strong&gt;SCSS&lt;/strong&gt; (Sassy CSS), which revolutionized the way styles are written and maintained. Gone are the days of battling endless CSS declarations and specificity wars. SASS, a magical land where styles are organized, efficient, and simply delightful. With SASS, developers can take CSS to the next level, making styling tasks easier and more enjoyable. &lt;/p&gt;

&lt;p&gt;In this blog, we'll dive into the details of SASS, and see how it has revolutionized styling in modern web development.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SASS is the most mature, stable, and powerful professional grade CSS extension language in the world (Extension of CSS3, To write Smarter and Dynamic CSS, To Write CSS like a programmer).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  SASS or SCSS? 🤔
&lt;/h2&gt;

&lt;p&gt;SASS, born in 2006, to bring structure and superpowers to the CSS world. With SASS, developers were given two syntax options: &lt;code&gt;.sass&lt;/code&gt; and &lt;code&gt;.scss&lt;/code&gt;. Though both offer similar functionality, they have some differences in usage.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.sass&lt;/code&gt; opts for a more concise syntax, appealing to those who prefer a cleaner, indention-based structure (similar to what we see in Python).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.scss&lt;/code&gt; adopts a syntax similar to CSS, making it more approachable for developers familiar with the CSS with curly braces and semicolons. It is newer and recommended.&lt;/li&gt;
&lt;/ul&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%2Fo5cucjkvsm1ccxybahc8.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%2Fo5cucjkvsm1ccxybahc8.png" alt="SASS Vs SCSS" width="767" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Don't worry about the differences between the two flavors for now. Both achieve the same results, so choose whichever feels more comfortable to you! For this blog, we'll stick with the &lt;code&gt;.scss&lt;/code&gt; syntax, which closely resembles normal CSS and is easier for beginners.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modern Browser Support 🌐
&lt;/h2&gt;

&lt;p&gt;As web technologies evolve, browser support becomes pivotal for adopting new styling techniques. Luckily, modern browsers have warmly welcomed the features brought by SASS and SCSS, guaranteeing a smooth experience for developers. This broad support enables developers to fully utilize SASS's capabilities without concerns about compatibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's dive deeper into the world of SASS! 👇
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CSS is typically more static&lt;/strong&gt;, although it does offer some native features like variables. Now, imagine SASS as a superhero for our CSS. It bestows upon us numerous superpowers, allowing us to transform our static CSS files into something dynamic, resembling a programming language. With SASS, we can incorporate concepts such as variables, functions, loops, and more, enhancing the dynamism and maintainability of our stylesheets.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: SASS is a CSS preprocessor that allows us to write more powerful and maintainable CSS. However, browsers cannot directly read SASS files. We need to first convert them into normal CSS files that browsers can understand. While some modern browsers have built-in support for reading certain SASS features, it's still essential to learn them in order to use them effectively. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we use SASS with modern frameworks or libraries, they often handle the conversion process automatically. However, if we want to use SASS with our regular HTML files, we'll need to perform the conversion ourselves. In VSCode, there's a useful plugin called &lt;strong&gt;live-sass-compiler&lt;/strong&gt; that can assist with this process. &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%2Fenctryf1r1qoat4xweex.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%2Fenctryf1r1qoat4xweex.png" alt="Live Sass Compiler" width="774" height="296"&gt;&lt;/a&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we're working in a JavaScript application using Node.js, we can add SASS to our project using &lt;code&gt;npm&lt;/code&gt; by running a command:&lt;br&gt;
&lt;code&gt;npm install -g sass&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's explore the powers in detail! ✨&lt;/p&gt;
&lt;h3&gt;
  
  
  1) Variables 🔥
&lt;/h3&gt;

&lt;p&gt;Imagine this: setting a color or font size once and being able to use it anywhere in our stylesheets. With variables, that's exactly what we can do! Say goodbye to the days of copying and pasting colors and fonts all over our CSS. By defining variables, prefixed with a &lt;code&gt;$&lt;/code&gt; sign, we can set them once and reuse them throughout our stylesheets. This not only keeps our styles consistent but also makes them a breeze to update whenever needed, keeping our code organized and efficient.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//style.scss&lt;/span&gt;
&lt;span class="nv"&gt;$primary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$heading-font&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Roboto'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$primary-color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$heading-font&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See how we define variables for color and font, and then use them throughout! Change the variables, and our entire site updates like magic!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: In plain CSS, we can define variables using the traditional &lt;code&gt;var&lt;/code&gt; method, but many developers are not familiar with this approach or haven't used it in their projects. However, it's essential to be aware of native elements like this. &lt;br&gt;
More information on: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Nesting 🔥
&lt;/h3&gt;

&lt;p&gt;Tired of writing long chains of selectors? Nesting lets us indent our styles to mirror our HTML structure, making our code more readable and intuitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//style.scss&lt;/span&gt;
&lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#f2f2f2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;list-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nd"&gt;::after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Test"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how the styles for the &lt;code&gt;nav&lt;/code&gt; and its nested elements closely mirror the HTML structure, making our code incredibly readable! (It's worth mentioning that modern browsers now have native support for reading style nesting).&lt;/p&gt;

&lt;p&gt;Also, note the usage of pseudo-selectors like &lt;code&gt;:hover&lt;/code&gt; and &lt;code&gt;::after&lt;/code&gt; with the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol. The &lt;code&gt;&amp;amp;&lt;/code&gt; symbol is a special feature in SASS known as the parent selector reference. It is used to concatenate the parent selector with the nested selector.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Mixins 🔥
&lt;/h3&gt;

&lt;p&gt;Are you tired of repeating the same styles over and over again? With mixins, we can create reusable code snippets for common styles, just like functions. They're our secret weapon for &lt;strong&gt;DRY&lt;/strong&gt; (Don't Repeat Yourself) coding, helping us save time and effort.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//style.scss&lt;/span&gt;
&lt;span class="k"&gt;@mixin&lt;/span&gt; &lt;span class="nf"&gt;button-style&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="mh"&gt;#ddd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;12px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;button-style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#4CAF50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.red-btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;button-style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#f44336&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;button-style&lt;/code&gt; mixin defines common styles for buttons, then we use it in &lt;code&gt;.btn&lt;/code&gt; and &lt;code&gt;.red-btn&lt;/code&gt; with specific colors. DRY power!&lt;br&gt;
Take note of the usage of the &lt;code&gt;@mixin&lt;/code&gt; and &lt;code&gt;@include&lt;/code&gt; keywords. &lt;code&gt;@mixin&lt;/code&gt; keyword is used to define a mixin, and &lt;code&gt;@include&lt;/code&gt; keyword is used to include a mixin within a selector.&lt;/p&gt;

&lt;p&gt;As mentioned earlier, mixins in SASS are similar to functions and can accept parameters. Let's explore another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//style.scss&lt;/span&gt;
&lt;span class="k"&gt;@mixin&lt;/span&gt; &lt;span class="nf"&gt;flexclasses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$direction&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$bgcolor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$direction&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$bgcolor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.section1&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;flexclasses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;207&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;49&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;49&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.section2&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;@include&lt;/span&gt; &lt;span class="nd"&gt;flexclasses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;52&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;52&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="m"&gt;219&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;flexclasses&lt;/code&gt; mixin accepts two parameters: &lt;code&gt;$direction&lt;/code&gt; and &lt;code&gt;$bgcolor&lt;/code&gt;. When we &lt;code&gt;@include&lt;/code&gt; the mixin in the &lt;code&gt;.section1&lt;/code&gt; and &lt;code&gt;.section2&lt;/code&gt; selectors, we provide specific values for these parameters. This allows us to customize the behavior of the mixin based on the needs of each selector.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: In SASS, all keywords, such as &lt;code&gt;@mixin&lt;/code&gt;, &lt;code&gt;@include&lt;/code&gt;, and so on, begin with the &lt;code&gt;@&lt;/code&gt; symbol. This symbol distinguishes them from regular CSS syntax and identifies them as SASS-specific directives or features.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4) Partials/Modules 🔥
&lt;/h3&gt;

&lt;p&gt;Partials in SASS ensure modularity by breaking down a large file into smaller, more manageable files. For example, we can create partial files like &lt;code&gt;_variables.scss&lt;/code&gt; and &lt;code&gt;_mixins.scss&lt;/code&gt; to modularize our codebase and handle complex styles more effectively. This approach promotes code reusability and maintainability.&lt;/p&gt;

&lt;p&gt;In the examples provided, our variables and mixins are currently placed in the same &lt;code&gt;style.scss&lt;/code&gt; file. To enhance modularity, we can separate them into different partials. Here are the partials we can create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//_variables.scss&lt;/span&gt;
&lt;span class="nv"&gt;$primary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#333&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$heading-font&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Roboto'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//_mixins.scss&lt;/span&gt;
&lt;span class="k"&gt;@mixin&lt;/span&gt; &lt;span class="nf"&gt;button-style&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="mh"&gt;#ddd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;@mixin&lt;/span&gt; &lt;span class="nf"&gt;flexclasses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$direction&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$bgcolor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$direction&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$bgcolor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These partial files can then be included in the &lt;code&gt;style.scss&lt;/code&gt; file using the &lt;code&gt;@import&lt;/code&gt; directive, allowing us to organize our codebase more efficiently and improve overall maintainability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;//style.scss&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s1"&gt;'./variables'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s1"&gt;'./mixins'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Rest of the styles...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When creating partials in SASS, it's a convention to prefix the file names with an underscore (_). For example, &lt;code&gt;_variables.scss&lt;/code&gt; and &lt;code&gt;_mixins.scss&lt;/code&gt;. This helps distinguish partial files from regular SCSS files and indicates to other developers that these files are meant to be imported into other SCSS files rather than compiled separately.&lt;/p&gt;

&lt;h3&gt;
  
  
  5) Inheritance 🔥
&lt;/h3&gt;

&lt;p&gt;Think of styles as building blocks that we can build upon. With inheritance in SASS, we can define base styles and then extend them with specific modifications. This keeps our code DRY (Don't Repeat Yourself) and makes it easier to maintain and update in the long run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// style.scss&lt;/span&gt;
&lt;span class="nc"&gt;.big-btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;@extend&lt;/span&gt; &lt;span class="nc"&gt;.btn&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We defined a &lt;code&gt;.btn&lt;/code&gt; class earlier, the &lt;code&gt;.big-btn&lt;/code&gt; inherits all styles from &lt;code&gt;.btn&lt;/code&gt; using &lt;code&gt;@extend&lt;/code&gt;, then just adds a bigger font size. No code duplication!&lt;/p&gt;

&lt;h3&gt;
  
  
  6) Looping 🔥
&lt;/h3&gt;

&lt;p&gt;Need to style a bunch of elements the same way? Loops let us generate repetitive styles in a flash. They automate repetitive styles, saving us time and ensuring consistency.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// style.scss&lt;/span&gt;
&lt;span class="k"&gt;@for&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="ow"&gt;from&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;to&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;h&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the provided code snippet, we use a normal &lt;code&gt;for&lt;/code&gt; loop with SASS syntax to style all headings from &lt;code&gt;h1&lt;/code&gt; to &lt;code&gt;h6&lt;/code&gt; with the color blue in just one line!&lt;/p&gt;

&lt;p&gt;The dynamic usage of the current variable inside the loop is achieved using &lt;code&gt;#{$i}&lt;/code&gt;. This &lt;strong&gt;interpolation&lt;/strong&gt; syntax(with &lt;code&gt;#&lt;/code&gt;) allows us to insert the current value of the variable &lt;code&gt;i&lt;/code&gt; directly into the selector, generating styles for each heading dynamically.&lt;br&gt;
This demonstrates the power and flexibility of SASS loops in automating repetitive styling tasks with ease.&lt;/p&gt;

&lt;p&gt;See another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// style.scss&lt;/span&gt;
&lt;span class="k"&gt;@for&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="ow"&gt;from&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;through&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.m&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="nb"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.mt-&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="nb"&gt;px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another example of a concise SASS loop. Can you guess what the compiled output will be?&lt;/p&gt;

&lt;p&gt;Indeed, it will generate margin classes from &lt;code&gt;.m1&lt;/code&gt; to &lt;code&gt;.m10&lt;/code&gt; and corresponding margin-top classes from &lt;code&gt;.mt-1&lt;/code&gt; to &lt;code&gt;.mt-10&lt;/code&gt;, with pixel values ranging from &lt;code&gt;1px&lt;/code&gt; to &lt;code&gt;10px&lt;/code&gt; assigned as their values. And if we need classes up to &lt;code&gt;.m100&lt;/code&gt;, there's no need to worry. We can easily achieve that by adjusting the loop parameter from 10 to 100.&lt;/p&gt;

&lt;p&gt;This illustrates the efficiency of using loops to generate such classes. Do you see the power and flexibility they provide?&lt;/p&gt;

&lt;p&gt;Let's explore another example with a different type of loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="c1"&gt;// style.scss&lt;/span&gt;
&lt;span class="nv"&gt;$menu-items&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;home&lt;/span&gt; &lt;span class="n"&gt;about&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt; &lt;span class="n"&gt;contact&lt;/span&gt; &lt;span class="n"&gt;newitem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@each&lt;/span&gt; &lt;span class="nv"&gt;$item&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$menu-items&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;.&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="nv"&gt;$item&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nt"&gt;color&lt;/span&gt;&lt;span class="nd"&gt;:hotpink&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we use the &lt;code&gt;@each&lt;/code&gt; directive to iterate over each item in the &lt;code&gt;$menu-items&lt;/code&gt; list. For each item, we dynamically generate a CSS class with the item's name as its selector and apply a common style of &lt;code&gt;color: hotpink&lt;/code&gt;. This approach allows us to efficiently apply styles to multiple elements based on a predefined list.&lt;/p&gt;

&lt;p&gt;Feel free to explore other SASS loops and their usage if you're more curious about their capabilities!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion 🤔🙌
&lt;/h2&gt;

&lt;p&gt;In simple terms, SCSS(or SASS) is like a supercharged version of CSS that makes styling websites easier and more efficient. With SCSS, developers can use handy features like variables, nesting, and mixins to write cleaner and more organized code. Whether you're new to web development or a seasoned pro, learning SCSS is essential for keeping up with the latest trends and making our projects shine. And the best part? It's not too complicated to pick up and start using right away!&lt;/p&gt;

&lt;p&gt;This blog offered just a glimpse of SASS's potential, based on my learnings. I understand it's not a new subject; SASS has been around for a while. The recent motivation to revisit and write this blog came from a colleague who asked me about SASS.😊&lt;/p&gt;

&lt;p&gt;Are you interested in further exploration? If so, here are some additional resources to consider:&lt;br&gt;
&lt;em&gt;SASS Documentation:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://sass-lang.com/documentation/" rel="noopener noreferrer"&gt;https://sass-lang.com/documentation/&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Interactive SASS Playground:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://sass-lang.com/playground" rel="noopener noreferrer"&gt;https://sass-lang.com/playground&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.sassmeister.com/" rel="noopener noreferrer"&gt;https://www.sassmeister.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, say goodbye to CSS chaos and welcome the serenity of SASS! Our stylesheets will appreciate the switch.😉🔥&lt;/p&gt;

&lt;p&gt;Thanks for reading. 🙌&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>🔟Lesser-Used Yet Valuable HTML Tags👨‍💻</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Fri, 09 Feb 2024 14:17:33 +0000</pubDate>
      <link>https://dev.to/sudhil/lesser-used-yet-valuable-html-tags-3ndh</link>
      <guid>https://dev.to/sudhil/lesser-used-yet-valuable-html-tags-3ndh</guid>
      <description>&lt;h2&gt;
  
  
  Introduction ✨
&lt;/h2&gt;

&lt;p&gt;HTML is fundamental to our journey as developers, serving as a cornerstone since the beginning of our software development endeavors. Over time, native HTML has evolved alongside modern technology and browser advancements.&lt;/p&gt;

&lt;p&gt;This article explores few of the very useful HTML tags that developers often overlook. Some of these tags have been introduced in recent years, offering innovative solutions to common challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;picture&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This tag allows developers to specify multiple image sources based on device resolutions or screen sizes, offering enhanced control over responsive images compared to the traditional &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"image-small.jpg"&lt;/span&gt; &lt;span class="na"&gt;media=&lt;/span&gt;&lt;span class="s"&gt;"(max-width: 767px)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"image-large.jpg"&lt;/span&gt; &lt;span class="na"&gt;media=&lt;/span&gt;&lt;span class="s"&gt;"(min-width: 768px)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Description of image"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;With &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt;, developers can define reusable HTML fragments that can be dynamically cloned and inserted into the document via JavaScript (One of the key aspects of Web Components). It simplifies client-side template creation without the need for string manipulation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"myTemplate"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a template content.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;These tags enable developers to create collapsible content sections, where &lt;code&gt;&amp;lt;summary&amp;gt;&lt;/code&gt; serves as a visible heading for the &lt;code&gt;&amp;lt;details&amp;gt;&lt;/code&gt; element&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;details&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;Click to expand&lt;span class="nt"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hidden content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/details&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Representing a dialog box or modal window, &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; can be programmatically opened or closed via JavaScript within an HTML document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dialog&lt;/span&gt; &lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Greetings, one and all!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;"dialog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;OK&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dialog&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;datalist&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;option&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;These tags offer predefined options for  elements with types "text" or "search", allowing users to select from the list or enter their own value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;list=&lt;/span&gt;&lt;span class="s"&gt;"browsers"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;datalist&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"browsers"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Chrome"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Firefox"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Safari"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/datalist&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;progress&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Used to represent the progress of tasks such as webpage loading, file uploads, or form submissions, &lt;code&gt;&amp;lt;progress&amp;gt;&lt;/code&gt; can be dynamically updated using JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;progress&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"70"&lt;/span&gt; &lt;span class="na"&gt;max=&lt;/span&gt;&lt;span class="s"&gt;"100"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/progress&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This tag is used to highlight or mark sections of text within a document. It is often used to indicate important or relevant content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is &lt;span class="nt"&gt;&amp;lt;mark&amp;gt;&lt;/span&gt;highlighted&lt;span class="nt"&gt;&amp;lt;/mark&amp;gt;&lt;/span&gt; text.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;&amp;lt;abbr&amp;gt;&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This tag defines an abbreviation or acronym within a document. It can be used to provide explanations or expansions for abbreviated terms.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;abbr&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Hypertext Markup Language"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;HTML&lt;span class="nt"&gt;&amp;lt;/abbr&amp;gt;&lt;/span&gt; is the standard markup language for creating web pages.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Thoughts 🤔💡
&lt;/h2&gt;

&lt;p&gt;These HTML elements, though less commonly used, offer valuable functionality for modern web development. While the prevalence of modern frontend tools and libraries may reduce their usage, it's beneficial to familiarize oneself with these native elements.&lt;/p&gt;

&lt;p&gt;Feel free to share additional items for inclusion in the list by commenting below.&lt;/p&gt;

&lt;p&gt;Thanks for reading. 🙌&lt;br&gt;
Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>html</category>
    </item>
    <item>
      <title>Exploring Web Components: Building Reusable UIs for Web Development 🌐👨‍💻</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Sun, 28 Jan 2024 20:41:03 +0000</pubDate>
      <link>https://dev.to/sudhil/exploring-web-components-building-reusable-uis-for-web-development-fhn</link>
      <guid>https://dev.to/sudhil/exploring-web-components-building-reusable-uis-for-web-development-fhn</guid>
      <description>&lt;p&gt;Even though Web Components have been around for a while, I've never used them in my projects, and I've never seen my colleagues use them either! Have you ever tried using Web Components?&lt;/p&gt;

&lt;p&gt;Web Components emerged around 2011 as a collection of web technologies aimed at making reusable custom elements for web development. These components include Custom Elements, Shadow DOM, HTML Templates, and HTML Imports (though the latter is now deprecated). They've evolved over time through collaboration between browser vendors, web standards bodies, and the web development community. With Web Components, we can create encapsulated custom elements with specific functionality and use them in our web applications to promote reusability and maintainability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concepts and usage 🚀✨
&lt;/h2&gt;

&lt;p&gt;As developers, we're aware that reusing code whenever possible is beneficial. However, custom markup structures, like complex HTML for custom UI controls, have traditionally posed challenges for reuse. Using them multiple times can clutter our page with tangled HTML, styles, and scripts if not managed carefully.&lt;br&gt;
Web Components aim to address these challenges by offering three main technologies that work together to create flexible custom elements. These elements encapsulate their functionality, allowing for easy reuse throughout our projects without worrying about code conflicts.&lt;/p&gt;
&lt;h3&gt;
  
  
  1) Custom elements 💡
&lt;/h3&gt;

&lt;p&gt;A set of JavaScript APIs that allows us to define custom elements and their behavior, which can then be used as desired in our user interface.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Custom Elements enable developers to define their own custom HTML elements with associated behavior.&lt;/li&gt;
&lt;li&gt;We can create new HTML tags that encapsulate specific functionality and use them just like standard HTML elements.&lt;/li&gt;
&lt;li&gt;Custom Elements are defined using the class syntax and extending the &lt;code&gt;HTMLElement&lt;/code&gt; class.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyComponent&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;HTMLElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// Initialization code&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;customElements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2) Shadow DOM 💡
&lt;/h3&gt;

&lt;p&gt;The Shadow DOM API comprises JavaScript APIs that allows us to attach an encapsulated "shadow" DOM tree to an element. This shadow DOM tree is rendered independently from the main document DOM, keeping the element's features private. By doing so, we can script and style the element without worrying about conflicts with other parts of the document. This encapsulation ensures that the element's functionality remains contained and isolated, enhancing maintainability and reducing the risk of unintended interactions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Shadow DOM allows us to encapsulate the internal structure and styling of a custom element.&lt;/li&gt;
&lt;li&gt;It provides a scoped DOM tree, isolated from the rest of the document, preventing styles and scripts from leaking into or out of the component.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyComponent&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;HTMLElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shadowRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attachShadow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;shadowRoot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;p&amp;gt;This is inside the shadow DOM&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;customElements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-component&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  3) HTML templates 💡
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;slot&amp;gt;&lt;/code&gt; elements enable us to write markup templates that are not displayed in the rendered page. These can then be reused multiple times as the basis of a custom element's structure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML Templates allow developers to declare fragments of HTML that can be cloned and inserted into the DOM dynamically.&lt;/li&gt;
&lt;li&gt;Templates are often used in conjunction with Custom Elements to define the internal structure of a component.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"my-template"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;/* Styles for the template */&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a template content.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4) HTML Imports (deprecated)
&lt;/h3&gt;

&lt;p&gt;HTML Imports were initially part of the Web Components specification but have been deprecated in favor of using ES6 modules and other module systems. Developers are encouraged to use modern module systems and tools for managing dependencies.&lt;/p&gt;

&lt;p&gt;So the basic approach for implementing a web component generally looks something like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a class in which we specify our web component functionality, using the class syntax.&lt;/li&gt;
&lt;li&gt;Register our new custom element using the &lt;code&gt;CustomElementRegistry.define()&lt;/code&gt; method, passing it the element name to be defined, the class or function in which its functionality is specified, and optionally, what element it inherits from.&lt;/li&gt;
&lt;li&gt;If required, attach a shadow DOM to the custom element using &lt;code&gt;Element.attachShadow()&lt;/code&gt; method. Add child elements, event listeners, etc., to the shadow DOM using regular DOM methods.&lt;/li&gt;
&lt;li&gt;If required, define an HTML template using &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;slot&amp;gt;&lt;/code&gt;. Again use regular DOM methods to clone the template and attach it to our shadow DOM.&lt;/li&gt;
&lt;li&gt;Use our custom element wherever we like on our page, just like we would any regular HTML element.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Working Example 👨‍💻🔥
&lt;/h2&gt;

&lt;p&gt;We'll define a custom HTML element called &lt;code&gt;&amp;lt;my-button&amp;gt;&lt;/code&gt; that displays a button with customizable text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt; &lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;template&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
   &amp;lt;style&amp;gt;
      /* Styles for the button */
      :host {
         display: inline-block;
      }
      button {
         padding: 10px 20px;
         font-size: 16px;
         background-color: #ffa500;
         color: #fff;
         border: none;
         border-radius: 5px;
         cursor: pointer;
      }
      button:hover {
         background-color: #f5ab25;
      }
   &amp;lt;/style&amp;gt;
   &amp;lt;button&amp;gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&amp;lt;/button&amp;gt;`&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyButton&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;HTMLElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="c1"&gt;// Create a shadow root&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shadowRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attachShadow&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;open&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
     &lt;span class="c1"&gt;// Clone the template content and append it to the shadow DOM&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cloneNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;shadowRoot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// connectedCallback(){ }&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;customElements&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MyButton&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//NOTE: The name must have atleast one hyphen(-) in it.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can use the &lt;code&gt;&amp;lt;my-button&amp;gt;&lt;/code&gt; custom element in any HTML file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- index.html --&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Custom Button - Web Component&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;defer&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"button.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;my-button&amp;gt;&lt;/span&gt;Hi, I am Custom Button!&lt;span class="nt"&gt;&amp;lt;/my-button&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;index.html&lt;/code&gt; in a web browser, and we should see a button labeled "Hi, I am Custom Button!". This button is rendered using the &lt;code&gt;&amp;lt;my-button&amp;gt;&lt;/code&gt; custom element defined in &lt;code&gt;button.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7pgb6mmq1dbnnezhq71.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%2Fp7pgb6mmq1dbnnezhq71.png" alt="Final Output" width="285" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts 🤔💡
&lt;/h2&gt;

&lt;p&gt;In summary, traditional web development using plain HTML involves manual coding and styling of UI elements, whereas Web Components offer a structured and modular approach. With encapsulated behavior and styling, thanks to features like shadow DOM, Web Components lead to more maintainable and scalable codebases. Additionally, they provide a standardized method for creating reusable and interoperable components across various frameworks and libraries. While adoption may vary, Web Components offer powerful tools for building modular and maintainable web applications.&lt;/p&gt;

&lt;p&gt;Happy Coding! 🚀👨‍💻✨&lt;/p&gt;

</description>
      <category>web</category>
    </item>
    <item>
      <title>Navigating Code Realms: Tales from 7 Years in Software 🌐👨‍💻</title>
      <dc:creator>Sudhil Raj K</dc:creator>
      <pubDate>Sat, 20 Jan 2024 13:34:45 +0000</pubDate>
      <link>https://dev.to/sudhil/navigating-code-realms-tales-from-7-years-in-software-3n3o</link>
      <guid>https://dev.to/sudhil/navigating-code-realms-tales-from-7-years-in-software-3n3o</guid>
      <description>&lt;p&gt;Hey there! I'm diving into the world of blogging on &lt;a href="https://dev.to/"&gt;Dev.to&lt;/a&gt;, and for my maiden voyage, I want to keep it real. No tech jargon, just a simple chat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Am I Here?
&lt;/h2&gt;

&lt;p&gt;After seven years in the software world, I've gathered quite a few stories. I've been a part of the software development landscape since before the arrival of modern AI tools, and now, I continue to navigate this ever-changing terrain. I'm not here to show off my coding skills; I'm here to share what I've learned along the way. From the early days of confusion to now, where problem-solving is second nature – I want you to join me on this journey to share, to learn, and to foster a community that thrives on collective wisdom.🤝&lt;/p&gt;

&lt;h2&gt;
  
  
  What's In Store?
&lt;/h2&gt;

&lt;p&gt;This blog is like a diary of a coder. I'll spill the beans on those "aha!" moments, the times I got stuck, and how I found my way out. Expect stories, not just about finding solutions but the crazy adventures we face while coding.📖&lt;/p&gt;

&lt;h2&gt;
  
  
  Join Me on the Ride
&lt;/h2&gt;

&lt;p&gt;If you're a fellow coder or just curious about what happens behind the scenes, let's make this a conversation. No complex stuff, just a chat among friends in the coding world. I've got seven years of tales to share, and I'm excited to see what you think.🗣️&lt;/p&gt;

&lt;p&gt;So, buckle up! We're in for a ride on this coder's journey, where the code is but a reflection of the stories we craft and the challenges we conquer. Let's make it a fun one together!✨&lt;/p&gt;

&lt;p&gt;Happy Coding! 🚀👨‍💻&lt;/p&gt;

</description>
      <category>career</category>
    </item>
  </channel>
</rss>
