<?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: Swarup Mahato</title>
    <description>The latest articles on DEV Community by Swarup Mahato (@swarupinfotech1).</description>
    <link>https://dev.to/swarupinfotech1</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%2F1637507%2Fa59c0873-53c8-46ca-a1ab-b3ef8adaf0cb.png</url>
      <title>DEV Community: Swarup Mahato</title>
      <link>https://dev.to/swarupinfotech1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swarupinfotech1"/>
    <language>en</language>
    <item>
      <title>Hacker Using Metasploit and Nmap for Offensive Security in 2025</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Fri, 27 Jun 2025 09:24:28 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/hacker-using-metasploit-and-nmap-for-offensive-security-in-2025-4j0</link>
      <guid>https://dev.to/swarupinfotech1/hacker-using-metasploit-and-nmap-for-offensive-security-in-2025-4j0</guid>
      <description>&lt;p&gt;Boost Your Cyber Arsenal: 100 Must-Have Linux Security Tools for 2025&lt;/p&gt;

&lt;p&gt;Take your offensive security game to the next level with Swarup Mahato’s expertly curated guide of 100 essential Linux tools — trusted by ethical hackers, red teamers, and penetration testers worldwide.&lt;/p&gt;

&lt;p&gt;This powerful toolkit includes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;🔹 Core Pentesting Tools: Metasploit, Nmap, Wireshark&lt;br&gt;
🔹 Web App Testing Tools: sqlmap, Burp Suite, Nikto&lt;br&gt;
🔹 Wireless Attack Tools: Aircrack-ng, Kismet&lt;br&gt;
🔹 Digital Forensics Tools: Volatility, Sleuth Kit&lt;br&gt;
🔹 Cloud Infrastructure Tools: Docker, Kubernetes, Terraform&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Each tool comes with a brief, actionable description to ensure fast deployment and maximum impact during engagements.&lt;/p&gt;

&lt;p&gt;🔐 Whether you're a student, security researcher, bug bounty hunter, or part of a red team—bookmark this list to build, upgrade, or audit your hacking toolkit for success in 2025 and beyond.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>archlinux</category>
      <category>hacker</category>
      <category>tools</category>
    </item>
    <item>
      <title>Build an awesome developer portfolio website.</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Tue, 10 Jun 2025 07:36:07 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/build-an-awesome-developer-portfolio-website-5gak</link>
      <guid>https://dev.to/swarupinfotech1/build-an-awesome-developer-portfolio-website-5gak</guid>
      <description>&lt;p&gt;As a software developer, it's important to have a robust portfolio website that can display our abilities and experiences. To assist other developers, I have designed a portfolio website using Next, Tailwind CSS, and EmailJS. In this article, I will provide a step-by-step guide on the setup process, along with the GitHub link.&lt;/p&gt;

&lt;p&gt;Here is the live preview:&lt;br&gt;
&lt;a href="https://swarup-portfolio-pro.vercel.app" rel="noopener noreferrer"&gt;Live preview url&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;STEP 01:&lt;/strong&gt;&lt;br&gt;
Clone the Repository using &lt;a href="https://github.com/swarupinfotech" rel="noopener noreferrer"&gt;GitHub link&lt;/a&gt; and change the directory to the developer-portfolio.&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;git&lt;/span&gt; &lt;span class="nx"&gt;clone&lt;/span&gt; &lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//github.com/swarupinfotech/developer-portfolio.git&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;developer&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;portfolio&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 02:&lt;/strong&gt;&lt;br&gt;
Now install all packages using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&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;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, all packages, Now change all data on &lt;code&gt;utils/data/*&lt;/code&gt; according to you. For 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="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;personalData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Swarup Mahato&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/profile.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;designation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Software Developer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is Swarup Mahato. I am a professional and enthusiastic programmer in my daily life. I am a quick learner with a self-learning attitude. I love to learn and explore new technologies and am passionate about problem-solving. I love almost all the stacks of web application development and love to make the web more open to the world. My core skill is based on JavaScript and I love to do most of the things using JavaScript. I am available for any kind of job opportunity that suits my skills and interests.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;info@swarupinfotech.in&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;+91 9142922542&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mango Jamshedpur, Jharkhand 831012 &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;github&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://github.com/swarupinfotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.facebook.com/profile.php?id=100069856215966&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;linkedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.linkedin.com/in/sarup-m-1a1372288/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://x.com/SwarupInfotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;stackOverflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://stackoverflow.com/users/22920700/swarup-infotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;leetcode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://leetcode.com/u/lL3NvWLd4u/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;devUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;swarupinfotech1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#&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;The &lt;code&gt;devusername&lt;/code&gt; properties replace it with your &lt;code&gt;dev.to&lt;/code&gt; &lt;code&gt;username&lt;/code&gt; and it will &lt;code&gt;fetch&lt;/code&gt; all blogs from your &lt;code&gt;dev.to&lt;/code&gt; website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 03:&lt;/strong&gt;&lt;br&gt;
Now we will make a &lt;code&gt;.env&lt;/code&gt; file and set up our &lt;code&gt;Email.JS&lt;/code&gt; credential in a &lt;code&gt;.env&lt;/code&gt; file. I am using EmailJs in this project for the user to send mail to me and It's free. The &lt;code&gt;.env&lt;/code&gt; file will be the following:&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;NEXT_PUBLIC_EMAILJS_SERVICE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="nx"&gt;NEXT_PUBLIC_EMAILJS_TEMPLATE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="nx"&gt;NEXT_PUBLIC_EMAILJS_PUBLIC_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First of all, go to &lt;a href="https://www.emailjs.com/" rel="noopener noreferrer"&gt;Emailjs.com&lt;/a&gt; and sign up for an account.&lt;/p&gt;

&lt;p&gt;Make a &lt;a href="https://dashboard.emailjs.com/sign-in" rel="noopener noreferrer"&gt;email service&lt;/a&gt; using &lt;code&gt;Gmail&lt;/code&gt; and take the &lt;code&gt;Service ID&lt;/code&gt; and add it &lt;code&gt;.env&lt;/code&gt; file as &lt;code&gt;REACT_APP_YOUR_SERVICE_ID&lt;/code&gt; value.&lt;/p&gt;

&lt;p&gt;Then make a &lt;a href="https://dashboard.emailjs.com/sign-in" rel="noopener noreferrer"&gt;Email template&lt;/a&gt; and take &lt;code&gt;Template ID&lt;/code&gt; from the template setting and use it &lt;code&gt;.env&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then go to &lt;a href="https://dashboard.emailjs.com/sign-in" rel="noopener noreferrer"&gt;Account&lt;/a&gt; and take &lt;code&gt;Public Key&lt;/code&gt; and use it in &lt;code&gt;.env&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 04:&lt;/strong&gt;&lt;br&gt;
Now the portfolio website is ready for the run. You can run it using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&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;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like the portfolio project Please give it a star on the GitHub Repository.&lt;br&gt;
You can connect with me on Linkedin: &lt;a href="https://www.linkedin.com/in/sarup-m-1a1372288/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sarup-m-1a1372288/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>portfolio</category>
      <category>webdev</category>
      <category>nextjs</category>
      <category>devpolio</category>
    </item>
    <item>
      <title>Build an awesome GitHub developer portfolio.</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Tue, 10 Jun 2025 06:49:44 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/build-an-awesome-github-developer-portfolio-427</link>
      <guid>https://dev.to/swarupinfotech1/build-an-awesome-github-developer-portfolio-427</guid>
      <description>&lt;p&gt;In the software development world, it's crucial to effectively present your work alongside the code you write. A portfolio website is an excellent way for developers to showcase their skills, projects, and contributions. One innovative way to enhance your portfolio is by integrating GitHub statistics, which can provide real-time insights into your coding activity and contributions.&lt;/p&gt;

&lt;p&gt;To assist other developers in achieving this, I have created a new website from scratch that highlights your GitHub works. The website is built using NextJS and Tailwind CSS, and it fetches all data from your GitHub profile and work.&lt;/p&gt;

&lt;p&gt;This article will guide you through the setup process step by step, and it will also provide you with the GitHub link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the live preview&lt;/strong&gt;: &lt;a href="https://github-dashboard-sepia.vercel.app/" rel="noopener noreferrer"&gt;Live preview url&lt;/a&gt;&lt;br&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%2Ffrpx13kt3gtaboh0su3b.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%2Ffrpx13kt3gtaboh0su3b.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  STEP 01:
&lt;/h2&gt;

&lt;p&gt;Clone the Repository using &lt;a href="https://github.com/swarupinfotech/github-dashboard/tree/main?tab=readme-ov-file" rel="noopener noreferrer"&gt;GitHub link&lt;/a&gt; and change the directory to the github-portfolio.&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;git&lt;/span&gt; &lt;span class="nx"&gt;clone&lt;/span&gt; &lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//github.com/swarupinfotech/github-dashboard.git&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;github&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;dashboard&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  STEP 02:
&lt;/h2&gt;

&lt;p&gt;Now install all packages using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&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;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, all packages, Now change all data on &lt;code&gt;data/user-data.js&lt;/code&gt; according to you. For 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="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;githubUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;swarupinfotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;devUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;swarupinfotech1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;github&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://github.com/swarupinfotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.facebook.com/profile.php?id=100069856215966&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;linkedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.linkedin.com/in/sarup-m-1a1372288/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://x.com/SwarupInfotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;stackOverflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://stackoverflow.com/users/22920700/swarup-infotech&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;leetcode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://leetcode.com/u/lL3NvWLd4u/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;skills&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;React&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NextJS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Redux&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NestJS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MySql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MongoDB&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Postgres&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Docker&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;AWS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;+6&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;h2&gt;
  
  
  STEP 03:
&lt;/h2&gt;

&lt;p&gt;If you want to use Google Analytics, Please create a new &lt;code&gt;.env&lt;/code&gt; file from the &lt;code&gt;.env.example&lt;/code&gt; file and provide the value. The &lt;code&gt;.env&lt;/code&gt; file will be the following:&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;NEXT_PUBLIC_GTM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  STEP 04:
&lt;/h2&gt;

&lt;p&gt;Now the GitHub portfolio website is ready for the run. You can run it using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&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;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like this GitHub portfolio project you can consider giving it a star on the &lt;a href="https://github.com/swarupinfotech/github-dashboard/tree/main?tab=readme-ov-file" rel="noopener noreferrer"&gt;GitHub Repository.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can connect with me on Linkedin: &lt;a href="https://www.linkedin.com/in/sarup-m-1a1372288/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/sarup-m-1a1372288/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclaimer: In this repository, I have used some open-source APIs. All credits go to the owners of those repositories.&lt;/p&gt;

</description>
      <category>portfolio</category>
      <category>developer</category>
      <category>github</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Scop in Javascript with example</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Mon, 09 Jun 2025 07:58:04 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/scop-in-javascript-with-example-5h47</link>
      <guid>https://dev.to/swarupinfotech1/scop-in-javascript-with-example-5h47</guid>
      <description>&lt;p&gt;avaScript is a powerful and versatile programming language that is widely used for web development. One of the key concepts in JavaScript is scope, which refers to the accessibility of variables, functions, and objects within a program. In this blog post, we will explain the different types of scope in JavaScript, including global scope, local scope, and function scope, and provide examples to help you understand how they work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Global scope
&lt;/h2&gt;

&lt;p&gt;Global scope in JavaScript refers to variables, functions, and objects that can be accessed from anywhere within a program. These variables, functions, and objects are defined outside of any function or block of code.&lt;br&gt;
&lt;strong&gt;For example, consider the following code:&lt;/strong&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;globalVariable&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;myFunction&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;globalVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// prints "Hello, World!"&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;globalVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// prints "Hello, World!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;globalVariable&lt;/code&gt; is declared outside of any function or block of code, making it accessible from anywhere within the program. Both the &lt;code&gt;myFunction&lt;/code&gt; function and the &lt;code&gt;console.log&lt;/code&gt; statement outside of the function are able to access and print the value of &lt;code&gt;globalVariable&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local scope
&lt;/h2&gt;

&lt;p&gt;Local scope in JavaScript refers to variables, functions, and objects that can only be accessed within a specific block of code. These variables, functions, and objects are defined within a block of code, such as a &lt;code&gt;if&lt;/code&gt; statement or a &lt;code&gt;for&lt;/code&gt; loop.&lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&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;localVariable&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="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;localVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// prints "Hello, World!"&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;localVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// throws an error, localVariable is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;localVariable&lt;/code&gt; is defined within the &lt;code&gt;if&lt;/code&gt; statement, making it only accessible within that block of code. The &lt;code&gt;console.log&lt;/code&gt; statement within the if statement is able to access and print the value of &lt;code&gt;localVariable&lt;/code&gt;, but the &lt;code&gt;console.log&lt;/code&gt; statement outside of the &lt;code&gt;if&lt;/code&gt;statement throws an error because &lt;code&gt;localVariable&lt;/code&gt; is not defined in the global scope.&lt;/p&gt;

&lt;h2&gt;
  
  
  Function scope
&lt;/h2&gt;

&lt;p&gt;Function scope in JavaScript refers to variables, functions, and objects that can only be accessed within a specific function. These variables, functions, and objects are defined within a function, and are not accessible outside of that function.&lt;br&gt;
&lt;strong&gt;For example, consider the following code:&lt;/strong&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;myFunction&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;functionVariable&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="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;functionVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// prints "Hello, World!"&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;functionVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// throws an error, functionVariable is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;functionVariable&lt;/code&gt; is defined within the &lt;code&gt;myFunction&lt;/code&gt; function, making it only accessible within that function. The &lt;code&gt;console.log&lt;/code&gt; statement within the function is able to access and print the value of &lt;code&gt;functionVariable&lt;/code&gt;, but the &lt;code&gt;console.log&lt;/code&gt; statement outside of the function throws an error because &lt;code&gt;functionVariable&lt;/code&gt; is not defined in the global or local scope.&lt;/p&gt;

&lt;p&gt;In conclusion, understanding the concept of scope in JavaScript is essential for writing clean, efficient, and maintainable code. There are three types of scope in JavaScript: global scope, local scope, and function scope. Global scope refers to variables, functions, and objects that can be accessed from anywhere within a program, local scope refers to variables, functions, and objects that can only be accessed within a specific block of code, and function scope refers to variables, functions, and objects that&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>developer</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Scop in Javascript.</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Mon, 09 Jun 2025 07:49:15 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/scop-in-javascript-5gnb</link>
      <guid>https://dev.to/swarupinfotech1/scop-in-javascript-5gnb</guid>
      <description>&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%2Fh5fvsqrq2nz50wiv2kyw.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%2Fh5fvsqrq2nz50wiv2kyw.png" alt="Image description" width="800" height="496"&gt;&lt;/a&gt;&lt;br&gt;
JavaScript, renowned for its versatility, stands as a pivotal language in the realm of web development. Core to its essence lies the concept of scope, delineating the reach of variables, functions, and objects within a codebase. In this discourse, we delve into the nuanced dimensions of scope in JavaScript, encapsulating global scope, local scope, and function scope, complemented by illustrative examples to illuminate their workings.&lt;/p&gt;
&lt;h2&gt;
  
  
  Global Scope
&lt;/h2&gt;

&lt;p&gt;Global scope encompasses variables, functions, and objects accessible from any part of a program, having their origins outside any encapsulating function or code block. Take, for instance, the following snippet:&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;let&lt;/span&gt; &lt;span class="nx"&gt;globalVariable&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;myFunction&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;globalVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: "Hello, World!"&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;globalVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: "Hello, World!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;globalVariable&lt;/code&gt; is globally defined, thus accessible both within &lt;code&gt;myFunction&lt;/code&gt; and beyond, exemplifying the unrestricted nature of global scope.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local Scope
&lt;/h2&gt;

&lt;p&gt;Contrarily, local scope confines variables, functions, and objects to specific code blocks, like an &lt;code&gt;if&lt;/code&gt; statement or a &lt;code&gt;for&lt;/code&gt; loop. Witness this in action:&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;if &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="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;localVariable&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="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;localVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: "Hello, World!"&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;localVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Throws an error: localVariable is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this scenario, &lt;code&gt;localVariable&lt;/code&gt; finds existence solely within the confines of the &lt;code&gt;if&lt;/code&gt; statement, inaccessible beyond its territorial borders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Function Scope
&lt;/h2&gt;

&lt;p&gt;Function scope relegates variables, functions, and objects to the confines of a particular function, rendering them inaccessible outside its precincts. Behold:&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;myFunction&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;functionVariable&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="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;functionVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: "Hello, World!"&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;functionVariable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Throws an error: functionVariable is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;functionVariable&lt;/code&gt; finds sanctuary solely within &lt;code&gt;myFunction&lt;/code&gt;, beyond the grasp of external scopes, delineating the essence of function scope.&lt;/p&gt;

&lt;p&gt;In summation, mastery of scope in JavaScript stands as a cornerstone for crafting elegant, effective, and maintainable codebases. Global scope affords ubiquitous access, local scope offers compartmentalization within code blocks, and function scope provides encapsulation within functions, collectively weaving the intricate fabric of JavaScript's scoping paradigm.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
      <category>developer</category>
    </item>
    <item>
      <title>Asynchronous programming in Javascript</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Mon, 09 Jun 2025 07:26:08 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/asynchronous-programming-in-javascript-4mni</link>
      <guid>https://dev.to/swarupinfotech1/asynchronous-programming-in-javascript-4mni</guid>
      <description>&lt;p&gt;JavaScript, being a single-threaded language, can only process one task at a time. This can result in long wait times for complex tasks, as the script will be blocked from executing any other tasks until it has been completed. To tackle this, JavaScript offers asynchronous programming, which allows the script to continue executing other tasks while it waits for an asynchronous task to complete. In this blog, we’ll explore the basics of asynchronous programming in JavaScript and how it can be achieved through the use of callback functions, promises, and async/await.&lt;/p&gt;

&lt;h2&gt;
  
  
  Callback Functions
&lt;/h2&gt;

&lt;p&gt;A callback function is a function that is passed as an argument to another function and is executed after the main function has been completed. Callbacks are used in asynchronous programming to wait for a task to complete before executing the next step.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function slowTask(callback) {
  setTimeout(() =&amp;gt; {
    console.log("Slow task completed.");
    callback();
  }, 1000);
}

function runProgram() {
  console.log("Program started.");
  slowTask(() =&amp;gt; {
    console.log("Callback function executed.");
  });
  console.log("Program ended.");
}

runProgram();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;slowTask&lt;/code&gt; function takes a callback as an argument. The &lt;code&gt;slowTask&lt;/code&gt; function uses &lt;code&gt;setTimeout&lt;/code&gt; to delay the execution of a task for one second. The &lt;code&gt;runProgram&lt;/code&gt; function calls &lt;code&gt;slowTask&lt;/code&gt; and passes a callback function as an argument. The &lt;code&gt;runProgram&lt;/code&gt; function also logs "Program started" and "Program ended". When the &lt;code&gt;slowTask&lt;/code&gt; function has been completed, it logs "Slow task completed" and executes the callback function, which logs "Callback function executed".&lt;br&gt;
The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program started.
Program ended.
Slow task completed.
Callback function executed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Promises
&lt;/h2&gt;

&lt;p&gt;Promises are a more modern approach to asynchronous programming in JavaScript. A promise represents the result of an asynchronous operation and can be in one of three states: pending, fulfilled, or rejected. A promise can be created using the &lt;code&gt;Promise&lt;/code&gt; constructor, and its state can be determined using the &lt;code&gt;then&lt;/code&gt; and &lt;code&gt;catch&lt;/code&gt; methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const slowTask = new Promise((resolve, reject) =&amp;gt; {
  setTimeout(() =&amp;gt; {
    resolve("Slow task completed.");
  }, 1000);
});

function runProgram() {
  console.log("Program started.");
  slowTask
    .then((result) =&amp;gt; {
      console.log(result);
    })
    .catch((error) =&amp;gt; {
      console.error(error);
    });
  console.log("Program ended.");
}

runProgram();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;slowTask&lt;/code&gt; is a promise that is resolved after one second with the result "Slow task completed.". The &lt;code&gt;runProgram&lt;/code&gt; function calls &lt;code&gt;slowTask&lt;/code&gt; and uses the &lt;code&gt;then&lt;/code&gt; method to log the result when the promise is fulfilled.&lt;br&gt;
The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program started.
Program ended.
Slow task completed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Async/Await
&lt;/h2&gt;

&lt;p&gt;Async/await is the latest and most readable way to handle asynchronous operations in JavaScript. It allows developers to write asynchronous code that looks like synchronous code, making it easier to understand and maintain. The async keyword is used to declare an asynchronous function, and the await keyword is used to wait for a promise to be resolved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is an example to demonstrate the use of async/await in JavaScript:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function fetchData() {
  const response = await fetch("https://api.example.com/data");
  const data = await response.json();
  console.log(data);
}

fetchData()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;;&lt;br&gt;
In this example, the &lt;code&gt;fetchData&lt;/code&gt; function is declared as asynchronous using the &lt;code&gt;async&lt;/code&gt; keyword. The function uses fetch to retrieve data from an API, and &lt;code&gt;await&lt;/code&gt; is used to wait for the fetch operation to complete. The resolved response is then transformed into a JSON object using &lt;code&gt;response.json()&lt;/code&gt;. The &lt;code&gt;await&lt;/code&gt;keyword is used to wait for the JSON transformation to complete, and the final result is logged to the console.&lt;/p&gt;

&lt;p&gt;It's important to note that the code within an asynchronous function will be executed asynchronously, but the code outside of the function will still be executed synchronously. Also, the await keyword can only be used within an asynchronous function.&lt;/p&gt;

&lt;p&gt;In conclusion, asynchronous programming in JavaScript allows the script to continue executing other tasks while it waits for an asynchronous task to complete. Callback functions, promises, and async/await are three ways to achieve asynchronous programming in JavaScript. Callback functions are the simplest and most basic way to handle asynchronous operations, while promises offer a more modern and flexible approach. Async/await provides the most readable way to handle asynchronous operations and is the recommended method for modern JavaScript programming. Understanding asynchronous programming in JavaScript is important for creating efficient and responsive applications, and is a must-have skill for any JavaScript developer.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>react</category>
      <category>asynchrous</category>
    </item>
    <item>
      <title>Scop in Javascript with example</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Sun, 08 Jun 2025 04:25:25 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/scop-in-javascript-with-example-3hf6</link>
      <guid>https://dev.to/swarupinfotech1/scop-in-javascript-with-example-3hf6</guid>
      <description>&lt;p&gt;JavaScript is a powerful and versatile programming language that is widely used for web development. One of the key concepts in JavaScript is scope, which refers to the accessibility of variables, functions, and objects within a program. In this blog post, we will explain the different types of scope in JavaScript, including global scope, local scope, and function scope, and provide examples to help you understand how they work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Global scope
&lt;/h2&gt;

&lt;p&gt;Global scope in JavaScript refers to variables, functions, and objects that can be accessed from anywhere within a program. These variables, functions, and objects are defined outside of any function or block of code.&lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let globalVariable = "Hello, World!";

function myFunction() {
  console.log(globalVariable); // prints "Hello, World!"
}

console.log(globalVariable); // prints "Hello, World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;globalVariable&lt;/code&gt;is declared outside of any function or block of code, making it accessible from anywhere within the program. Both the &lt;code&gt;myFunction&lt;/code&gt; function and the &lt;code&gt;console.log&lt;/code&gt; statement outside of the function are able to access and print the value of&lt;code&gt;globalVariable&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local scope
&lt;/h2&gt;

&lt;p&gt;Local scope in JavaScript refers to variables, functions, and objects that can only be accessed within a specific block of code. These variables, functions, and objects are defined within a block of code, such as a &lt;code&gt;if&lt;/code&gt; statement or a &lt;code&gt;for&lt;/code&gt; loop.&lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
  let localVariable = "Hello, World!";
  console.log(localVariable); // prints "Hello, World!"
}

console.log(localVariable); // throws an error, localVariable is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;localVariable&lt;/code&gt; is defined within the &lt;code&gt;if&lt;/code&gt; statement, making it only accessible within that block of code. The &lt;code&gt;console.log&lt;/code&gt;statement within the if statement is able to access and print the value of &lt;code&gt;localVariable&lt;/code&gt;, but the &lt;code&gt;console.log&lt;/code&gt; statement outside of the ifstatement throws an error because &lt;code&gt;localVariable&lt;/code&gt; is not defined in the global scope.&lt;/p&gt;

&lt;h2&gt;
  
  
  Function scope
&lt;/h2&gt;

&lt;p&gt;Function scope in JavaScript refers to variables, functions, and objects that can only be accessed within a specific function. These variables, functions, and objects are defined within a function, and are not accessible outside of that function.&lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  let functionVariable = "Hello, World!";
  console.log(functionVariable); // prints "Hello, World!"
}

console.log(functionVariable); // throws an error, functionVariable is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;functionVariable&lt;/code&gt; is defined within the &lt;code&gt;myFunction&lt;/code&gt; function, making it only accessible within that function. The console.log statement within the function is able to access and print the value of &lt;code&gt;functionVariable&lt;/code&gt;, but the &lt;code&gt;console.log&lt;/code&gt; statement outside of the function throws an error because &lt;code&gt;functionVariable&lt;/code&gt; is not defined in the global or local scope.&lt;/p&gt;

&lt;p&gt;In conclusion, understanding the concept of scope in JavaScript is essential for writing clean, efficient, and maintainable code. There are three types of scope in JavaScript: global scope, local scope, and function scope. Global scope refers to variables, functions, and objects that can be accessed from anywhere within a program, local scope refers to variables, functions, and objects that can only be accessed within a specific block of code, and function scope refers to variables, functions, and objects that&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to create a Popover using React and Tailwind CSS</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Sun, 08 Jun 2025 04:11:39 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/how-to-create-a-popover-using-react-and-tailwind-css-40on</link>
      <guid>https://dev.to/swarupinfotech1/how-to-create-a-popover-using-react-and-tailwind-css-40on</guid>
      <description>&lt;p&gt;&lt;code&gt;Popover&lt;/code&gt; is a common &lt;code&gt;UI element&lt;/code&gt; in web applications, providing a way to display additional information or options when interacting with a particular element. With &lt;code&gt;React&lt;/code&gt; and &lt;code&gt;TailwindCSS&lt;/code&gt;, most of the time developers use an &lt;code&gt;npm library&lt;/code&gt; for the &lt;code&gt;Popover&lt;/code&gt; or &lt;code&gt;Popover&lt;/code&gt;. You know, when we use an npm library, it increases the &lt;code&gt;project build sizes&lt;/code&gt;.&lt;br&gt;
In this article, I will create a reusable &lt;code&gt;Popover component&lt;/code&gt; using &lt;code&gt;Tailwind CSS&lt;/code&gt;. We will use &lt;code&gt;click&lt;/code&gt; and &lt;code&gt;hover&lt;/code&gt; triggers for the Popover.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Popover component:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// @flow strict
"use client"
import { useEffect, useRef, useState } from "react";

function ReactPopover({
  children,
  content,
  trigger = "click"
}) {
  const [show, setShow] = useState(false);
  const wrapperRef = useRef(null);

  const handleMouseOver = () =&amp;gt; {
    if (trigger === "hover") {
      setShow(true);
    };
  };

  const handleMouseLeft = () =&amp;gt; {
    if (trigger === "hover") {
      setShow(false);
    };
  };

  useEffect(() =&amp;gt; {
    function handleClickOutside(event) {
      if (wrapperRef.current &amp;amp;&amp;amp; !wrapperRef.current.contains(event.target)) {
        setShow(false);
      }
    }

    if (show) {
      // Bind the event listener
      document.addEventListener("mousedown", handleClickOutside);
      return () =&amp;gt; {
        // Unbind the event listener on clean up
        document.removeEventListener("mousedown", handleClickOutside);
      };
    }
  }, [show, wrapperRef]);

  return (
    &amp;lt;div
      ref={wrapperRef}
      onMouseEnter={handleMouseOver}
      onMouseLeave={handleMouseLeft}
      className="w-fit h-fit relative flex justify-center"&amp;gt;
      &amp;lt;div
        onClick={() =&amp;gt; setShow(!show)}
      &amp;gt;
        {children}
      &amp;lt;/div&amp;gt;
      &amp;lt;div
        hidden={!show}
        className="min-w-fit w-[200px] h-fit absolute bottom-[100%] z-50 transition-all"&amp;gt;
        &amp;lt;div className="rounded bg-white p-3 shadow-[10px_30px_150px_rgba(46,38,92,0.25)] mb-[10px]"&amp;gt;
          {content}
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default ReactPopover;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this component the &lt;code&gt;trigger&lt;/code&gt; default value is &lt;code&gt;click&lt;/code&gt;and you can pass &lt;code&gt;hover&lt;/code&gt; as an attribute. When you click outside of the &lt;code&gt;Popover&lt;/code&gt;, the Popover will be closed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use the Popover component:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ReactPopover from "@/components/common/react-popover";

const Page = () =&amp;gt; {
  return (
    &amp;lt;div className="w-screen h-screen flex justify-center items-center gap-4"&amp;gt;
      &amp;lt;ReactPopover
        content={
          &amp;lt;p&amp;gt;This Content Will be render in Popover.&amp;lt;/p&amp;gt;
        }
      &amp;gt;
        &amp;lt;button className="bg-indigo-500 px-4 py-1.5 border rounded text-white"&amp;gt;
          Click me
        &amp;lt;/button&amp;gt;
      &amp;lt;/ReactPopover&amp;gt;
      &amp;lt;ReactPopover
        trigger="hover"
        content={
          &amp;lt;p&amp;gt;This Content Will be render in Popover.&amp;lt;/p&amp;gt;
        }
      &amp;gt;
        &amp;lt;button className="bg-indigo-500 px-4 py-1.5 border rounded text-white"&amp;gt;
          Hover me
        &amp;lt;/button&amp;gt;
      &amp;lt;/ReactPopover&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default Page;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tailwindcss</category>
      <category>react</category>
      <category>nextjs</category>
      <category>css</category>
    </item>
    <item>
      <title>GitHub and EC2 manual deployment with Deploy keys</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Sun, 08 Jun 2025 03:51:14 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/github-and-ec2-manual-deployment-with-deploy-keys-19m2</link>
      <guid>https://dev.to/swarupinfotech1/github-and-ec2-manual-deployment-with-deploy-keys-19m2</guid>
      <description>&lt;p&gt;For those looking to quickly deploy a project, whether it’s a prototype or a solo endeavor, manual deployment with GitHub and AWS EC2 is a reliable and efficient method. Here’s a comprehensive guide to setting up your deployment using deploy keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Your EC2 Instance
&lt;/h2&gt;

&lt;p&gt;Begin by launching an on-demand EC2 instance on AWS. Access this instance via SSH, and use Git to clone or pull your repository. This setup will be similar to your local development environment, except you’ll need to configure environment variables specific to your server.&lt;/p&gt;

&lt;p&gt;To ensure your server is secure, configure nginx with SSL certificates. This adds a layer of security and professionalism to your deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using GitHub Deploy Keys
&lt;/h2&gt;

&lt;p&gt;Deploy keys provide a secure, read-only connection between your EC2 instance and your GitHub repository. Here’s how to set them up:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Generate SSH Keys&lt;/strong&gt;&lt;br&gt;
First, generate an SSH key pair on your EC2 instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t ed25519 -f ~/.ssh/my_project_deploy_key -C "your_email@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;ed25519&lt;/code&gt; instead of the more common RSA provides better security. The &lt;code&gt;-C&lt;/code&gt; flag is optional but useful if you plan to use the key for commit signing in addition to deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Add the Public Key to GitHub&lt;/strong&gt;&lt;br&gt;
In your GitHub repository, navigate to &lt;strong&gt;Settings &amp;gt; Deploy keys&lt;/strong&gt;. Click Add &lt;strong&gt;Deploy Key&lt;/strong&gt;, provide a descriptive title like "EC2 Deployment Key", and paste the contents of your public key file (&lt;code&gt;~/.ssh/my_project_deploy_key.pub&lt;/code&gt;). For most deployment scenarios, you won’t need to enable write access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Configure SSH for Git&lt;/strong&gt;&lt;br&gt;
To allow your EC2 instance to access multiple repositories without using the default &lt;code&gt;id_rsa&lt;/code&gt; key name, configure your SSH client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vim ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following entries to the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host github.com-my_project
  HostName github.com
  IdentityFile ~/.ssh/my_project_deploy_key
  User git

Host github.com-other_project
  HostName github.com
  IdentityFile ~/.ssh/other_deploy_key
  User git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration allows you to manage multiple repositories with different keys.&lt;/p&gt;

&lt;p&gt;To clone your repository, use the configured host:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone git@github.com-my_project:your_github_org/your_repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then use &lt;code&gt;git pull&lt;/code&gt; as needed to update your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving Your Deployment Process
&lt;/h2&gt;

&lt;p&gt;While this manual setup is quick and effective, it does have some limitations, such as downtime during updates. To minimize downtime, consider using a process manager like &lt;a href="https://futurestud.io/tutorials/pm2-cluster-mode-and-zero-downtime-restarts" rel="noopener noreferrer"&gt;pm2&lt;/a&gt;, which supports zero-downtime restarts.&lt;/p&gt;

&lt;p&gt;As your project grows, SSH-based manual deployments might become cumbersome. Automating your deployment process can save time and reduce errors. You can use GitHub webhooks to trigger automatic deployments or configure your server as a Git remote to push updates directly. This approach can streamline your workflow and enhance efficiency.&lt;/p&gt;

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

&lt;p&gt;Deploying with GitHub and EC2 using deploy keys is a straightforward and effective way to manage your projects, especially for quick prototypes and solo projects. This method allows you to leverage the power of AWS and GitHub without the overhead of more complex deployment strategies. Stay tuned for future posts where we’ll explore advanced deployment techniques and best practices.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>github</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Make an Image drag and drop with CSS in React</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Fri, 06 Jun 2025 08:54:28 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/make-an-image-drag-and-drop-with-css-in-react-3g5b</link>
      <guid>https://dev.to/swarupinfotech1/make-an-image-drag-and-drop-with-css-in-react-3g5b</guid>
      <description>&lt;p&gt;React is a popular JavaScript library for building user interfaces, and its flexibility and versatility make it a great choice for building interactive applications. In this tutorial, we will show you how to create a drag-and-drop feature for images using only CSS in React.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 —
&lt;/h2&gt;

&lt;p&gt;To start, let's set up a React project. You can use either Create React App or any other setup method that works best for you. Let's make a React application using create-react-app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app drag-and-drop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2 —
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;App.js&lt;/code&gt; and &lt;code&gt;App.css&lt;/code&gt; with the below code.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;App.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './App.css';

function App() {
  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;h2 className="heading"&amp;gt;Select Image:&amp;lt;/h2&amp;gt;
      &amp;lt;div className="image-area"&amp;gt;

      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;App.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.App {
  text-align: center;
  width: 100vw;
  height: 100vh;

}

.heading {
  font-size: 32px;
  font-weight: 500;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3 —
&lt;/h2&gt;

&lt;p&gt;Now create a new file and component &lt;code&gt;ImageContainer.js&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt;directory and take a div for drag and drop container.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ImageContainer.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

const ImageContainer = () =&amp;gt; {

    return (
        &amp;lt;div className="image-container"&amp;gt;

        &amp;lt;/div&amp;gt;
    );
};

export default ImageContainer;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then make a CSS file &lt;code&gt;ImageContainer.css&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt; directory and add some styles in the image container.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ImageContainer.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.image-container {
    width: 60%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(0, 0, 0, .3);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4 —
&lt;/h2&gt;

&lt;p&gt;Now we will take a div with an input field and input text title inside the&lt;code&gt;.image-container&lt;/code&gt; class and add some style in the &lt;code&gt;ImageContainer.css&lt;/code&gt; file. We will also take a state for the image URL and an onChage function for the update state.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ImageContainer.js will be&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import './ImageContainer.css';

const ImageContainer = () =&amp;gt; {
    const [url, setUrl] = React.useState('');

    const onChange = (e) =&amp;gt; {
        const files = e.target.files;
        files.length &amp;gt; 0 &amp;amp;&amp;amp; setUrl(URL.createObjectURL(files[0]));
    };

    return (
        &amp;lt;div className="image-container"&amp;gt;
            &amp;lt;div className="upload-container"&amp;gt;
                &amp;lt;input
                    type="file"
                    className="input-file"
                    accept=".png, .jpg, .jpeg"
                    onChange={onChange}
                /&amp;gt;
                &amp;lt;p&amp;gt;Drag &amp;amp; Drop here&amp;lt;/p&amp;gt;
                &amp;lt;p&amp;gt;or&amp;lt;/p&amp;gt;
                &amp;lt;p&amp;gt;Click&amp;lt;/p&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    );
};

export default ImageContainer;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ImageContainer.css will be&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.image-container {
    width: 60%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(0, 0, 0, .3);
}

.upload-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
}

.upload-container&amp;gt;p {
    font-size: 18px;
    margin: 4px;
    font-weight: 500;
}

.input-file {
    display: block;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5 —
&lt;/h2&gt;

&lt;p&gt;Now we will preview the image file conditionally. If you have dropped an image will render the image and or render the drag-and-drop area.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ImageContainer.js will be&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import './ImageContainer.css';

const ImageContainer = () =&amp;gt; {
    const [url, setUrl] = React.useState('');

    const onChange = (e) =&amp;gt; {
        const files = e.target.files;
        files.length &amp;gt; 0 &amp;amp;&amp;amp; setUrl(URL.createObjectURL(files[0]));
    };

    return (
        &amp;lt;div className="image-container"&amp;gt;
            {
                url ?
                    &amp;lt;img
                        className='image-view'
                        style={{ width: '100%', height: '100%' }}
                        src={url} alt="" /&amp;gt;
                    :
                    &amp;lt;div className="upload-container"&amp;gt;
                        &amp;lt;input
                            type="file"
                            className="input-file"
                            accept=".png, .jpg, .jpeg"
                            onChange={onChange}
                        /&amp;gt;
                        &amp;lt;p&amp;gt;Drag &amp;amp; Drop here&amp;lt;/p&amp;gt;
                        &amp;lt;p&amp;gt;or &amp;lt;span style={{ color: "blue" }} &amp;gt;Browse&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;

                    &amp;lt;/div&amp;gt;
            }
        &amp;lt;/div&amp;gt;
    );
};

export default ImageContainer;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6 —
&lt;/h2&gt;

&lt;p&gt;Now we will import the &lt;code&gt;ImageContainer&lt;/code&gt; component in our &lt;code&gt;App.js&lt;/code&gt; and run our application using the &lt;code&gt;npm start&lt;/code&gt; command and have fun while coding.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;App.js will be&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './App.css';
import ImageContainer from './ImageContainer';

function App() {
  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;h2 className="heading"&amp;gt;Select Image:&amp;lt;/h2&amp;gt;
      &amp;lt;div className="image-area"&amp;gt;
        &amp;lt;ImageContainer /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this tutorial, we showed you how to create a drag-and-drop feature for images using only CSS in React.&lt;/p&gt;

&lt;p&gt;You can grab the source code from here.&lt;a href="https://github.com/swarupinfotech" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>nextjs</category>
      <category>javascript</category>
      <category>css</category>
    </item>
    <item>
      <title>Top 10 React js interview questions.</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Fri, 06 Jun 2025 08:42:26 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/top-10-react-js-interview-questions-1e19</link>
      <guid>https://dev.to/swarupinfotech1/top-10-react-js-interview-questions-1e19</guid>
      <description>&lt;p&gt;As a React developer, it is important to have a solid understanding of the framework's key concepts and principles. With this in mind, I have put together a list of 10 important questions that every React developer should know, whether they are interviewing for a job or just looking to improve their skills.&lt;/p&gt;

&lt;p&gt;Before diving into the questions and answers, I suggest trying to answer each question on your own before looking at the answers provided. This will help you gauge your current level of understanding and identify areas that may need further improvement.&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  01. What is React and what are its benefits?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React is a JavaScript library for building user interfaces. It is used for building web applications because it allows developers to create reusable UI components and manage the state of the application in an efficient and organized way.&lt;/p&gt;

&lt;h2&gt;
  
  
  02. What is the virtual DOM and how does it work?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; The Virtual DOM (Document Object Model) is a representation of the actual DOM in the browser. It enables React to update only the specific parts of a web page that need to change, instead of rewriting the entire page, leading to increased performance.&lt;/p&gt;

&lt;p&gt;When a component's state or props change, React will first create a new version of the Virtual DOM that reflects the updated state or props. It then compares this new version with the previous version to determine what has changed.&lt;/p&gt;

&lt;p&gt;Once the changes have been identified, React will then update the actual DOM with the minimum number of operations necessary to bring it in line with the new version of the Virtual DOM. This process is known as "reconciliation".&lt;/p&gt;

&lt;p&gt;The use of a Virtual DOM allows for more efficient updates because it reduces the amount of direct manipulation of the actual DOM, which can be a slow and resource-intensive process. By only updating the parts that have actually changed, React can improve the performance of an application, especially on slow devices or when dealing with large amounts of data.&lt;/p&gt;

&lt;h2&gt;
  
  
  03. How does React handle updates and rendering?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles updates and rendering through a virtual DOM and component-based architecture. When a component's state or props change, React creates a new version of the virtual DOM that reflects the updated state or props, then compares it with the previous version to determine what has changed. React updates the actual DOM with the minimum number of operations necessary to bring it in line with the new version of the virtual DOM, a process called "reconciliation". React also uses a component-based architecture where each component has its own state and render method. It re-renders only the components that have actually changed. It does this efficiently and quickly, which is why React is known for its performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  04. What is the difference between state and props?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; State and props are both used to store data in a React component, but they serve different purposes and have different characteristics.&lt;/p&gt;

&lt;p&gt;Props (short for "properties") are a way to pass data from a parent component to a child component. They are read-only and cannot be modified by the child component.&lt;/p&gt;

&lt;p&gt;State, on the other hand, is an object that holds the data of a component that can change over time. It can be updated using the setState() method and is used to control the behavior and rendering of a component.&lt;/p&gt;

&lt;h2&gt;
  
  
  05. Can you explain the concept of Higher Order Components (HOC) in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; A Higher Order Component (HOC) in React is a function that takes a component and returns a new component with additional props. HOCs are used to reuse logic across multiple components, such as adding a common behavior or styling.&lt;/p&gt;

&lt;p&gt;HOCs are used by wrapping a component within the HOC, which returns a new component with the added props. The original component is passed as an argument to the HOC, and receives the additional props via destructuring. HOCs are pure functions, meaning they do not modify the original component, but return a new, enhanced component.&lt;/p&gt;

&lt;p&gt;For example, an HOC could be used to add authentication behavior to a component, such as checking if a user is logged in before rendering the component. The HOC would handle the logic for checking if the user is logged in, and pass a prop indicating the login status to the wrapped component.&lt;/p&gt;

&lt;p&gt;HOCs are a powerful pattern in React, allowing for code reuse and abstraction, while keeping the components modular and easy to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  06. What is the difference between server-side rendering and client-side rendering in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Server-side rendering (SSR) and client-side rendering (CSR) are two different ways of rendering a React application.&lt;/p&gt;

&lt;p&gt;In SSR, the initial HTML is generated on the server, and then sent to the client, where it is hydrated into a full React app. This results in a faster initial load time, as the HTML is already present on the page, and can be indexed by search engines.&lt;/p&gt;

&lt;p&gt;In CSR, the initial HTML is a minimal, empty document, and the React app is built and rendered entirely on the client. The client makes API calls to fetch the data required to render the UI. This results in a slower initial load time, but a more responsive and dynamic experience, as all the rendering is done on the client.&lt;/p&gt;

&lt;h2&gt;
  
  
  07. How do work useEffect hook in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; The useEffect hook in React allows developers to perform side effects such as data fetching, subscription, and setting up/cleaning up timers, in functional components. It runs after every render, including the first render, and after the render is committed to the screen. The useEffect hook takes two arguments - a function to run after every render and an array of dependencies that determines when the effect should be run. If the dependency array is empty or absent, the effect will run after every render.&lt;/p&gt;

&lt;h2&gt;
  
  
  08. How does React handle events and what are some common event handlers?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles events through its event handling system, where event handlers are passed as props to the components. Event handlers are functions that are executed when a specific event occurs, such as a user clicking a button. Common event handlers in React include onClick, onChange, onSubmit, etc. The event handler receives an event object, which contains information about the event, such as the target element, the type of event, and any data associated with the event. React event handlers should be passed&lt;br&gt;
as props to the components, and the event handlers should be defined within the component or in a separate helper function.&lt;/p&gt;

&lt;h2&gt;
  
  
  09. What are some best practices for performance optimization in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Best practices for performance optimization in React include using memoization, avoiding unnecessary re-renders, using lazy loading for components and images, and using the right data structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. How does React handle testing and what are some popular testing frameworks for React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles testing using testing frameworks such as Jest, Mocha, and Enzyme. Jest is a popular testing framework for React applications, while Mocha and Enzyme are also widely used.&lt;/p&gt;

&lt;p&gt;In conclusion, understanding key concepts and principles of React is crucial for every React developer. This article provides answers to 10 important questions related to React including what is React, the virtual DOM, how React handles updates and rendering, the difference between state and props, Higher Order Components, server-side rendering and client-side rendering, and more. Understanding these topics will help developers to build efficient and effective web applications using React.&lt;/p&gt;

&lt;p&gt;Connect with me on Linkedin : &lt;a href="https://www.linkedin.com/in/sarup-m-1a1372288/" rel="noopener noreferrer"&gt;Click here'👈&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gratitude</category>
      <category>career</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>Top 10 ES6 Features that Every Developer Should know</title>
      <dc:creator>Swarup Mahato</dc:creator>
      <pubDate>Fri, 06 Jun 2025 08:36:51 +0000</pubDate>
      <link>https://dev.to/swarupinfotech1/top-10-es6-features-that-every-developer-should-know-52pj</link>
      <guid>https://dev.to/swarupinfotech1/top-10-es6-features-that-every-developer-should-know-52pj</guid>
      <description>&lt;p&gt;JavaScript is one of the most widely-used programming languages in the world, and its popularity continues to grow. ES6, also known as ECMAScript 2015, introduced many new and exciting features to the JavaScript language. In this blog, we'll take a look at 10 advanced ES6 features that every JavaScript developer should master in order to stay ahead of the curve. Whether you're a beginner or an experienced developer, these features are sure to enhance your JavaScript skills and take your coding to the next level.&lt;/p&gt;

&lt;h2&gt;
  
  
  01. Arrow Functions:
&lt;/h2&gt;

&lt;p&gt;Arrow functions are a concise syntax for writing anonymous functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For instance, instead of writing this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const square = function (num) {
  return num * num;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;You can write the same code with an arrow function:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const square = (num) =&amp;gt; num * num;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  02. Template Literals:
&lt;/h2&gt;

&lt;p&gt;Template literals allow you to embed expressions in string literals. They use backticks instead of quotes and can be multi-line as well.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = "John";
const greeting = `Hello, ${name}!`;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  03. Destructuring:
&lt;/h2&gt;

&lt;p&gt;Destructuring allows you to extract data from arrays or objects into separate variables. This makes it easier to work with complex data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's an example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [1, 2, 3];
const [first, second, third] = numbers; //Array destructure

const person ={
  name: "John",
  age: 18,
}
const {name, age} = person; // Object destructure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  04. Spread Operator:
&lt;/h2&gt;

&lt;p&gt;The spread operator allows you to spread elements of an array or properties of an object into a new array or object. This is useful for merging arrays or objects, or for spreading an array into function arguments.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [1, 2, 3];
const newNumbers = [...numbers, 4, 5];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  05. Default Parameters:
&lt;/h2&gt;

&lt;p&gt;Default parameters allow you to specify default values for function parameters in case no value is passed. This makes it easier to handle edge cases and reduces the need for conditional statements.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const greet = (name = "John") =&amp;gt; {
  console.log(`Hello, ${name}!`);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  06. Rest Parameters:
&lt;/h2&gt;

&lt;p&gt;Rest parameters allow you to collect an indefinite number of arguments into an array. This is useful for writing functions that can accept any number of arguments.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sum = (...numbers) =&amp;gt; {
  let result = 0;
  for (const number of numbers) {
    result += number;
  }
  return result;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  07. Class Definitions:
&lt;/h2&gt;

&lt;p&gt;Class definitions provide a more object-oriented way of defining objects in JavaScript. They make it easier to create reusable objects with inheritance and encapsulation.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person {
  constructor(name) {
    this.name = name;
  }

  greet() {
    console.log(`Hello, my name is ${this.name}`);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  08. Modules:
&lt;/h2&gt;

&lt;p&gt;Modules allow you to organize your code into smaller, reusable pieces. This makes it easier to manage complex projects and reduces the risk of naming collisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a simple example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// greeting.js
export const greet = (name) =&amp;gt; {
  console.log(`Hello, ${name}!`);
};

// main.js
import { greet } from "./greeting.js";
greet("John");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  09. Promise:
&lt;/h2&gt;

&lt;p&gt;Promises are a way to handle asynchronous operations in JavaScript. They provide a way to handle errors, and can be combined to create complex asynchronous flows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a simple example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fetchData = () =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    setTimeout(() =&amp;gt; {
      resolve("Data fetched");
    }, 1000);
  });
};


fetchData().then((data) =&amp;gt; {
  console.log(data);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  10. Map and Set:
&lt;/h2&gt;

&lt;p&gt;The Map and Set data structures provide an efficient way to store unique values in JavaScript. They also provide a variety of useful methods for searching and manipulating the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Creating a Map
const map = new Map();
map.set("name", "John");
map.set("age", 30);

// Accessing values in a Map
console.log(map.get("name")); // Output: John
console.log(map.get("age")); // Output: 30

// Iterating over a Map
for (const [key, value] of map) {
  console.log(`${key}: ${value}`);
}

// Output:
// name: John
// age: 30

// Creating a Set
const set = new Set();
set.add("John");
set.add("Jane");
set.add("Jim");

// Iterating over a Set
for (const name of set) {
  console.log(name);
}

// Output:
// John
// Jane
// Jim

// Checking if a value exists in a Set
console.log(set.has("John")); // Output: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;In conclusion&lt;/strong&gt;, the advanced ES6 features outlined in this blog are essential for every JavaScript developer to master. They provide a more efficient, concise, and organized way of writing code, making it easier to work with complex data structures and handle asynchronous operations. Whether you're looking to improve your existing skills or just starting out with JavaScript, these features are an excellent starting point. Remember that becoming an expert in these features takes time and practice, so don't be discouraged if you don't understand everything right away. With consistent effort and dedication, you'll be able to master these advanced ES6 features and take your JavaScript skills to new heights.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>react</category>
      <category>node</category>
    </item>
  </channel>
</rss>
