<?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: Surbhi Dighe</title>
    <description>The latest articles on DEV Community by Surbhi Dighe (@surbhidighe).</description>
    <link>https://dev.to/surbhidighe</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%2F794190%2F7bdba206-f606-4905-a393-31298d1d32c2.png</url>
      <title>DEV Community: Surbhi Dighe</title>
      <link>https://dev.to/surbhidighe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/surbhidighe"/>
    <language>en</language>
    <item>
      <title>Understanding Params and Query Params: A Simple Guide</title>
      <dc:creator>Surbhi Dighe</dc:creator>
      <pubDate>Thu, 21 Dec 2023 17:31:07 +0000</pubDate>
      <link>https://dev.to/surbhidighe/understanding-params-and-query-params-a-simple-guide-1fi1</link>
      <guid>https://dev.to/surbhidighe/understanding-params-and-query-params-a-simple-guide-1fi1</guid>
      <description>&lt;p&gt;Have you ever looked at a web address and felt like what are these jumble of letters and symbols? These are nothing but the two friendly helpers called &lt;strong&gt;"params"&lt;/strong&gt; and &lt;strong&gt;"query params"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the context of web development and APIs, "params" and "query params" generally refer to different aspects of passing information in a URL or web address, particularly in the context of HTTP requests. &lt;br&gt;
Understanding these terms is easier than you might think.&lt;/p&gt;

&lt;p&gt;Let's take an example of a library website so that it will be easier to understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Params&lt;/strong&gt; - They are the parameters that are part of the URL path itself. Let's imagine, if a website is like a library, the params are like telling it which book you want to read. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example&lt;/strong&gt; - in below URL, "bookname" is a param in the path.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://library.com/book/bookname&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query Params&lt;/strong&gt; - They are included in the URL after a question mark (?) and are used to pass key-value pairs as part of the URL query string. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example&lt;/strong&gt; - in below URL, the author and category parameters are part of the query string. It is like Hey, can you show me books about action by surbhi?"&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://library.com/book?author=surbhi&amp;amp;category=action&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In summary, "params" generally refer to the parameters that are added in the path of the URL, while "query params" refer to the parameters in the query string. Both are different ways to pass data to a server or application, but they serve different purposes and are used in different parts of the URL.&lt;/p&gt;

&lt;p&gt;Happy Reading!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating Stylish Initial-Based Avatars in React</title>
      <dc:creator>Surbhi Dighe</dc:creator>
      <pubDate>Thu, 24 Aug 2023 10:53:58 +0000</pubDate>
      <link>https://dev.to/surbhidighe/creating-stylish-initial-based-avatars-in-react-277j</link>
      <guid>https://dev.to/surbhidighe/creating-stylish-initial-based-avatars-in-react-277j</guid>
      <description>&lt;p&gt;Have you ever noticed those little images on websites or apps that show the first letters of people's names? These are called "letter avatars." They're handy when users haven't uploaded a profile picture yet, and they add a nice touch to the interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are Letter Avatars?
&lt;/h3&gt;

&lt;p&gt;Letter avatars are like visual shortcuts for names. They're usually made up of the initial letters of a user's name or their first and last names. You might have seen single letters, two letters (for first and last names), or even three letters (for first, middle, and last names). These initials are often inside colored shapes like circles or squares, making them look cool and distinctive.&lt;/p&gt;

&lt;p&gt;In this blog post, we're going to learn how to create these letter avatars using ReactJS. Yes, you heard it right! Let's dive in.&lt;/p&gt;

&lt;h4&gt;
  
  
  Before We Start
&lt;/h4&gt;

&lt;p&gt;Before we get into the technical stuff, make sure you have a basic understanding of React and JavaScript. Also, grab a code editor and set up your React development environment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Building the ProfileImage Component
&lt;/h4&gt;

&lt;p&gt;We're going to build a component called ProfileImage. This smart component takes the user's name as input and generates a profile image using their initials.&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="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="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ProfileImage&lt;/span&gt; &lt;span class="o"&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nameParts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstNameInitial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;nameParts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;nameParts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&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="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lastNameInitial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;nameParts&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="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;nameParts&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;0&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="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user-profile-image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;firstNameInitial&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;lastNameInitial&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;ProfileImage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


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

&lt;/div&gt;
&lt;h4&gt;
  
  
  Adding Some Style
&lt;/h4&gt;

&lt;p&gt;To make these avatars visually appealing, we'll apply some basic CSS. Of course, you can tweak the CSS to match your project's design.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="nc"&gt;.main&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;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60vh&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="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.user-profile-image&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;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80px&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="no"&gt;brown&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="m"&gt;#ffffff&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;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;800&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 that we have our ProfileImage component, let's use it in our app.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./styles.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ProfileImage&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./ProfileImage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;br&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;main&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="nx"&gt;Profiles&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;br&gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ProfileImage&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;Surbhi Dighe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;br&gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

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

&lt;/div&gt;
&lt;h4&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  The Final Result&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;Ta-da! We're done. You've just learned how to create those nifty letter avatars using React. Now your user profiles will look more lively and engaging.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fqnbtieg14eyi1el9t10v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fqnbtieg14eyi1el9t10v.png" alt="Letter avatars"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Experience the live demo of initial-based avatars in action by clicking on the sandbox link: &lt;a href="https://codesandbox.io/s/letter-avatars-react-qwsr6p" rel="noopener noreferrer"&gt;Letter Avatars React - Live Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You also have the option to utilize the npm package for achieving the same functionality. The &lt;a href="https://www.npmjs.com/package/react-name-initials-avatar" rel="noopener noreferrer"&gt;&lt;strong&gt;react-name-initials-avatar&lt;/strong&gt;&lt;/a&gt; library offers a user-friendly solution to generate lettered avatars derived from usernames. This package is designed to produce visually pleasing avatars adorned with initials, thereby simplifying user identification at a quick glance.&lt;/p&gt;

&lt;p&gt;Remember, this is just a starting point. You can expand and customize these avatars as you see fit. Happy coding! 🚀&lt;/p&gt;

</description>
      <category>avatars</category>
      <category>react</category>
      <category>javascript</category>
      <category>profilepicture</category>
    </item>
    <item>
      <title>Why I Chose to Start My Career in Frontend Development: A Personal Journey</title>
      <dc:creator>Surbhi Dighe</dc:creator>
      <pubDate>Mon, 15 May 2023 09:28:41 +0000</pubDate>
      <link>https://dev.to/surbhidighe/why-i-chose-to-start-my-career-in-frontend-development-a-personal-journey-5g8h</link>
      <guid>https://dev.to/surbhidighe/why-i-chose-to-start-my-career-in-frontend-development-a-personal-journey-5g8h</guid>
      <description>&lt;p&gt;From a young age, I’ve always been fascinated by design.🎨 &lt;/p&gt;

&lt;p&gt;I found joy in drawing pictures, creating handmade cards, and experimenting with different fonts and colors on my computer. I was always seeking out new ways to express my creativity. As I grew older, this passion only intensified, and it eventually led me down the path of becoming a front-end developer.💥 💥&lt;/p&gt;

&lt;p&gt;Growing up, I was constantly creating things with my hands. I loved drawing, painting, and making crafts, and I was always eager to learn new techniques and styles.&lt;/p&gt;

&lt;p&gt;While studying computer science in college, I discovered the world of frontend development and was immediately hooked. The ability to create beautiful, interactive interfaces using code was like magic to me. I loved being able to take my designs and turn them into fully functioning websites and applications. I began experimenting with different software programs and online tools.&lt;/p&gt;

&lt;p&gt;After completing my graduation, I pursued my post-graduation. During this time, I became increasingly interested in frontend development. I was fortunate enough to be placed through college placements as a trainee software engineer and &lt;strong&gt;Guess what happened next!!&lt;/strong&gt; 🚀🚀&lt;/p&gt;

&lt;p&gt;I got my first opportunity to work in frontend development. It was an exciting and challenging experience, as I was tasked with creating interfaces that were not only aesthetically pleasing but also user-friendly and accessible. I spent countless hours researching and experimenting with different design principles, tools, and techniques to improve my skills and create better designs.&lt;/p&gt;

&lt;p&gt;Over the years, I’ve honed my skills in frontend development, working on a wide range of projects and collaborating with talented designers and developers. It has allowed me to combine my passion for design and technology, and has provided me with endless opportunities for growth and learning. I love being able to make someone’s experience online more enjoyable and seamless. The thrill of seeing a design concept come to life through code was unparalleled, and I knew that this was the career path I wanted to pursue.&lt;/p&gt;

&lt;p&gt;One of the things I love most about frontend development is the constant evolution of technology. There is always something new to learn, whether it’s a new JavaScript framework or a new design trend. It’s a field that requires both creativity and technical skill, which keeps me engaged and challenged.&lt;/p&gt;

&lt;p&gt;Reflecting on my journey, I’m thankful for the first chance I had to work in frontend development. It not only allowed me to gain new skills, but also opened up a world of possibilities that I could never have imagined. For anyone considering a career in this field, I urge you to take the leap and discover the exciting opportunities that await you. You never know, you might just find your true calling as I did!&lt;/p&gt;

&lt;p&gt;Thank you for reading!! 😃&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>career</category>
    </item>
    <item>
      <title>Understanding the Difference Between == and === in JavaScript</title>
      <dc:creator>Surbhi Dighe</dc:creator>
      <pubDate>Thu, 06 Apr 2023 18:27:21 +0000</pubDate>
      <link>https://dev.to/surbhidighe/understanding-the-difference-between-and-in-javascript-2bdm</link>
      <guid>https://dev.to/surbhidighe/understanding-the-difference-between-and-in-javascript-2bdm</guid>
      <description>&lt;p&gt;JavaScript provides two comparison operators, namely '==' and '==='. Both are used to compare two values, but they work differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Double Equals (==) Operator
&lt;/h2&gt;

&lt;p&gt;It is also known as loose equality operator. It compares two operands for equality after converting them to a common type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Example&lt;/strong&gt; - If the two operands are of different types, then the JavaScript engine will convert one of the operands to the same type as the other operand.&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="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;     &lt;span class="c1"&gt;// output=========&amp;gt; true &lt;/span&gt;

&lt;span class="c1"&gt;//Reason - because the number 5 is converted to the string 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Triple Equals (===) Operator
&lt;/h2&gt;

&lt;p&gt;It is also known as strict equality operator. It compares two operands for equality without converting them to a common type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Example&lt;/strong&gt; - If the two operands are of different types, then it will return false.&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="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;10&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;     &lt;span class="c1"&gt;// output=========&amp;gt; false &lt;/span&gt;

&lt;span class="c1"&gt;//Reason - because both the operands are of different data types&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is generally recommended to use the triple equal operator whenever possible to avoid unexpected behavior due to type coercion.&lt;/p&gt;

&lt;p&gt;Thank you for reading!!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Different Ways to Access Object Properties in JavaScript</title>
      <dc:creator>Surbhi Dighe</dc:creator>
      <pubDate>Sun, 02 Apr 2023 14:28:08 +0000</pubDate>
      <link>https://dev.to/surbhidighe/different-ways-to-access-object-properties-in-javascript-4g12</link>
      <guid>https://dev.to/surbhidighe/different-ways-to-access-object-properties-in-javascript-4g12</guid>
      <description>&lt;p&gt;There are different ways to access object properties in JavaScript&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Dot notation&lt;/strong&gt; - One common way to access object properties in JavaScript is through dot notation. This involves specifying the property name after the object name, with both separated by a dot.&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Surbhi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Dighe
};
console.log(name.firstName);  // Output: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;Surbhi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;
console.log(name.lastName);   // Output: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;Dighe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;2. Bracket notation&lt;/strong&gt; - Another way to access object properties is through bracket notation, which involves specifying the property name as a string inside square brackets.&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;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Surbhi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Dighe
};
console.log(name[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;]);  // Output: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;Surbhi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;
console.log(name[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;]);   // Output: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;Dighe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;3. Object destructuring&lt;/strong&gt; - It allows you to create variables that correspond to the properties of an object. By using object destructuring, you can easily extract specific values from an object and use them in your 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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Surbhi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Dighe
};
const { firstName, lastName } = name;
console.log(firstName);  // Output: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;Surbhi&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;
console.log(lastName);   // Output: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="nx"&gt;Dighe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Although there are various ways to access object properties in JavaScript, the &lt;strong&gt;dot notation&lt;/strong&gt; and &lt;strong&gt;bracket notation&lt;/strong&gt; are the most frequently used. &lt;/p&gt;

&lt;p&gt;Object destructuring is useful when you need to create variables from object properties.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>dotnotation</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>JavaScript program to find Unique elements from an array</title>
      <dc:creator>Surbhi Dighe</dc:creator>
      <pubDate>Sat, 15 Jan 2022 10:53:41 +0000</pubDate>
      <link>https://dev.to/surbhidighe/javascript-program-to-find-unique-elements-from-an-array-1a0e</link>
      <guid>https://dev.to/surbhidighe/javascript-program-to-find-unique-elements-from-an-array-1a0e</guid>
      <description>&lt;h2&gt;
  
  
  Following are the 2 ways to find distinct or unique elements from an array
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Using ES6 new Set&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;var array = [3,7,5,3,2,5,2,7];&lt;br&gt;
var unique_array = [...new Set(array)];&lt;br&gt;
console.log(unique_array);    // output = [3,7,5,2]&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Using For Loop&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;var array = [3,7,5,3,2,5,2,7];&lt;br&gt;
for(var i=0;i&amp;lt;array.length;i++)&lt;br&gt;
{&lt;br&gt;
for(var j=i+1;j&amp;lt;array.length;j++)&lt;br&gt;
{&lt;br&gt;
if(array[i]===array[j])&lt;br&gt;
{&lt;br&gt;
array.splice(j,1);&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
console.log(array); // output = [3,7,5,2]&lt;/code&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>array</category>
      <category>programming</category>
      <category>html</category>
    </item>
  </channel>
</rss>
