<?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>Forem: Santosh Viswanatham</title>
    <description>The latest articles on Forem by Santosh Viswanatham (@devcer).</description>
    <link>https://forem.com/devcer</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%2F138763%2F9120ed4b-04e1-4526-bf16-bfdaa2d36b14.jpeg</url>
      <title>Forem: Santosh Viswanatham</title>
      <link>https://forem.com/devcer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/devcer"/>
    <language>en</language>
    <item>
      <title>Building an Accessible SaaS Product: A Developer Guide</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Thu, 21 Mar 2024 08:41:47 +0000</pubDate>
      <link>https://forem.com/devcer/building-an-accessible-saas-product-a-developer-guide-bb6</link>
      <guid>https://forem.com/devcer/building-an-accessible-saas-product-a-developer-guide-bb6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5TXdAO-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2ADcjRJSY-My9gy7ygta43iQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5TXdAO-Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/1%2ADcjRJSY-My9gy7ygta43iQ.jpeg" alt="Photo by Daniel Ali on Unsplash" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In today’s digital landscape, accessibility is not just a nice-to-have feature or matter of compliance; it’s a legal and moral imperative, and it’s a fundamental aspect of the user experience. Creating products that are accessible to all users, including those with disabilities, is not only the right thing to do but also makes good business sense. Many organizations, before buying a software product, will additionally evaluate the accessibility aspect of the software before making the purchase decision. In this guide, we’ll explore the essential steps to building an accessible SaaS platform, ensuring that it complies with accessibility standards and best practices.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding Accessibility Standards 🌐
&lt;/h3&gt;

&lt;p&gt;Accessibility standards provide guidelines for making digital content and platforms accessible to users with disabilities. One of the most widely recognized standards is the &lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/"&gt;Web Content Accessibility Guidelines&lt;/a&gt; (WCAG), developed by the &lt;a href="https://www.w3.org/"&gt;World Wide Web Consortium&lt;/a&gt; (W3C).&lt;/p&gt;

&lt;p&gt;WCAG outlines four principles of accessibility: Perceivable, Operable, Understandable, and Robust (POUR), each with specific guidelines for achieving accessibility. WCAG uses three levels of conformance: A (lowest), AA, and AAA (highest). Aim for at least AA compliance to ensure your platform meets basic accessibility requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Elements of Accessibility 🔑
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Design with Accessibility in Mind 🎨
&lt;/h4&gt;

&lt;p&gt;It takes almost little to no effort or cost to incorporate accessibility considerations into the initial design phase. Pay attention to color contrast, font sizes, keyboard navigation, and other aspects affecting users with disabilities.&lt;/p&gt;

&lt;h4&gt;
  
  
  Semantic HTML 🏗️
&lt;/h4&gt;

&lt;p&gt;Use semantic HTML markup to ensure proper structure and navigation. This helps screen readers and other assistive technologies interpret content correctly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Keyboard Accessibility ⌨️
&lt;/h4&gt;

&lt;p&gt;Ensure that all functionality is operable via the keyboard alone. Users with motor disabilities may rely on keyboard navigation, so it’s essential to make sure all interactive elements are accessible this way.&lt;/p&gt;

&lt;h4&gt;
  
  
  Alternative Text and Captioning/Transcript for Media 🎥
&lt;/h4&gt;

&lt;p&gt;Provide descriptive alternative text for all images. This is crucial for users who are visually impaired and rely on screen readers to understand content. Include captions for audio and video content and provide transcripts for podcasts and other non-text content. This ensures that users who are deaf or hard of hearing can access the information.&lt;/p&gt;

&lt;h4&gt;
  
  
  Testing and Feedback 📝
&lt;/h4&gt;

&lt;p&gt;Regularly test your platform with users of diverse abilities and gather feedback to identify and address accessibility issues. Accessibility testing tools and user feedback are invaluable in ensuring your platform meets the needs of all users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility Tools for Testing and Validating 🛠️👨‍💻
&lt;/h3&gt;

&lt;p&gt;There are several tools available that can help you test your application for the Accessibility score. Every tool has its own criteria to evaluate the accessibility of your web application. Some of the tools that I prefer to use are&lt;/p&gt;

&lt;h4&gt;
  
  
  Chrome DevTools Accessibility Testing
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://developer.chrome.com/docs/lighthouse/accessibility/scoring"&gt;Lighthouse&lt;/a&gt;, A feature of Chrome DevTools offers a built-in accessibility testing feature that allows developers to identify and fix accessibility issues. By auditing elements and inspecting accessibility properties, developers can ensure their platform meets accessibility standards. The best of the tools is that, along with reporting issues, they also provide links to guides on how to fix them.&lt;/p&gt;

&lt;h4&gt;
  
  
  Silktide Browser Extension
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://silktide.com/"&gt;Silktide’s&lt;/a&gt; browser extension provides a user-friendly interface for testing website accessibility. With features like automated scans and detailed accessibility reports, developers can quickly identify and address accessibility barriers on their SaaS platform. Although there are several other extensions, I particularly like Silktide because it is one of the only tools that will give you a WCAG grade for every rule to help you understand your website’s compatibility with the grade.&lt;/p&gt;

&lt;h3&gt;
  
  
  Necessary Documentation for Accessibility Compliance 📄
&lt;/h3&gt;

&lt;p&gt;Even if your platform is accessible, Your customers may still mark you as Not accessible if you don’t list the necessary documents on your website that validate the accessibility of the application. So in addition to building an accessible platform, it’s essential to provide documentation demonstrating your commitment to accessibility and compliance with relevant standards. Here are some key documents to include:&lt;/p&gt;

&lt;h4&gt;
  
  
  Accessibility Policy
&lt;/h4&gt;

&lt;p&gt;A well-written accessibility policy should clearly state your organization’s commitment to accessibility. This should outline your accessibility philosophy, including your dedication to adhering to WCAG principles and making sure that accessibility is continuously improved. &lt;a href="https://www.w3.org/WAI/planning/org-policies/example/"&gt;Here&lt;/a&gt; is an example of the Accessibility Policy.&lt;/p&gt;

&lt;h4&gt;
  
  
  Accessibility Statement
&lt;/h4&gt;

&lt;p&gt;An accessibility statement communicates your platform’s level of accessibility and provides contact information for users to report accessibility issues. It should also include information on how users can request accommodations or assistance. You can use the &lt;a href="https://www.w3.org/WAI/planning/statements/"&gt;Accessibility Statement Generation tool&lt;/a&gt; on w3.org to generate this statement.&lt;/p&gt;

&lt;h4&gt;
  
  
  Accessibility Report
&lt;/h4&gt;

&lt;p&gt;Periodically publish an accessibility report that details the accessibility features of your product and any known issues or areas for improvement. This demonstrates transparency and accountability in your accessibility efforts. You can use the &lt;a href="https://www.w3.org/WAI/eval/report-tool/"&gt;report generation tool&lt;/a&gt; on w3.org to get this done.&lt;/p&gt;

&lt;p&gt;The tools on &lt;a href="https://www.w3.org/"&gt;w3.org&lt;/a&gt; are Incredibly helpful. They provide a step-by-step guide to make your product Accessible while generating the required documents.&lt;/p&gt;

&lt;p&gt;Building an accessible SaaS platform requires a commitment to understanding and implementing accessibility standards. By conducting thorough accessibility audits, creating comprehensive accessibility statements, using testing tools, adhering to WCAG guidelines, and leveraging resources from W3C, developers can ensure that their products are inclusive and usable by all. Remember, accessibility is not just a feature; it’s a fundamental aspect of digital equality.&lt;/p&gt;

&lt;p&gt;I would love to hear if you have any other tips or resources that you follow to make your application Accessible.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>saas</category>
      <category>web</category>
    </item>
    <item>
      <title>Hacktoberfest with Interledger: Join the Open Payments Movement</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sun, 08 Oct 2023 06:12:01 +0000</pubDate>
      <link>https://forem.com/devcer/hacktoberfest-with-interledger-join-the-open-payments-movement-cdb</link>
      <guid>https://forem.com/devcer/hacktoberfest-with-interledger-join-the-open-payments-movement-cdb</guid>
      <description>&lt;p&gt;&lt;a href="https://interledger.org/"&gt;Interledger&lt;/a&gt; is thrilled to announce it's participation in this year's Hacktoberfest edition. 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Hacktoberfest?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://hacktoberfest.com/"&gt;Hacktoberfest&lt;/a&gt; is a month-long celebration of Open Source that encourages people to contribute to open source throughout October. This year marks the 10th edition of Hacktoberfest. Every year, thousands of contributors participate in this festival to contribute to the projects they love and use, learn and enhance their skills to advance their careers, get mentorship, and feedback from industry experts. For organizations that believe in giving back to the community, Hacktoberfest is a fantastic platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interledger and Open Source 🌐
&lt;/h2&gt;

&lt;p&gt;The Interledger Foundation’s (ILF) mission is to broaden the diversity of voices in the tech ecosystem by using the Interledger Protocol (ILP) as a driver for digital financial inclusion. 🌍&lt;/p&gt;

&lt;p&gt;The Interledger Protocol is an open-source, currency-agnostic payments network that enables money to travel as quickly and efficiently as data on the internet. The open architecture and minimal protocol enable interoperability for any value transfer system.&lt;/p&gt;

&lt;p&gt;Interledger's objective is to enhance access to digital financial services by advocating for adopting an open-source currency network powered by the Interledger Protocol (ILP). Moreover, it actively collaborates with historically marginalized groups to fulfill this mission. These core values inspire us at Interledger to participate in &lt;a href="https://interledger.org/developers/hacktoberfest/"&gt;Hacktoberfest&lt;/a&gt;.💪&lt;/p&gt;

&lt;p&gt;This year marks the second edition of Interledger participating in Hacktoberfest.🎈&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributing to Interledger this Hacktoberfest 🌟
&lt;/h2&gt;

&lt;p&gt;There are multiple ways to contribute to Interledger this Hacktoberfest. You can build new features, find and fix bugs, write tests, help with documentation, organize digital/physical events to contribute to your community, and much more.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Get Started? 🚀
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Head over to our &lt;a href="https://github.com/interledger"&gt;GitHub repositories&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Filter repositories based on your skill set and interests.&lt;/li&gt;
&lt;li&gt;Please read the contribution guidelines before you start contributing.&lt;/li&gt;
&lt;li&gt;Find issues that are tagged with &lt;code&gt;Hacktoberfest&lt;/code&gt; labels. &lt;strong&gt;Tip:&lt;/strong&gt; Issues labeled as &lt;code&gt;good first issue&lt;/code&gt;/&lt;code&gt;goodfirstbug&lt;/code&gt; are ideal for new contributors.&lt;/li&gt;
&lt;li&gt;Once you've chosen an issue, work on your contribution.&lt;/li&gt;
&lt;li&gt;When you're ready, submit a pull request. Our maintainers and community members will review your work and provide feedback if necessary.&lt;/li&gt;
&lt;li&gt;After your pull request is merged, you've officially contributed to Interledger.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Offline events
&lt;/h2&gt;

&lt;p&gt;We would really love to partner with you and help with your Hacktoberfest events. If you are one who is part of a community and planning to conduct an event to educate and inform your community about Hacktoberfest then please fill out this &lt;a href="https://docs.google.com/forms/d/e/1FAIpQLSelsf2SWYHIZRAsA1XNUbXD8tEXRvmT9YV-hT3uPaLzJ098Gw/viewform"&gt;form&lt;/a&gt; and we will get in touch with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Few repositories that are participating in Hacktoberfest
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Rafiki
&lt;/h3&gt;

&lt;p&gt;Rafiki is open-source software that allows an Account Servicing Entity to enable Interledger functionality on its users' accounts.&lt;/p&gt;

&lt;p&gt;This includes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sending and receiving payments (via SPSP and Open Payments)&lt;/li&gt;
&lt;li&gt;allowing third-party access to initiate payments and view transaction data (via Open Payments)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Repo link&lt;/strong&gt; - &lt;a href="https://github.com/interledger/rafiki"&gt;https://github.com/interledger/rafiki&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Contribution guide&lt;/strong&gt; - &lt;a href="https://github.com/interledger/rafiki/blob/main/.github/contributing.md"&gt;https://github.com/interledger/rafiki/blob/main/.github/contributing.md&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testnet
&lt;/h3&gt;

&lt;p&gt;Testnet is an open-source test application for Rafiki. In other words, a Rafiki Playground. It wants to use all of the functionalities of Rafiki and put its advantages of to the real test.&lt;/p&gt;

&lt;p&gt;Testnet is made up (or will be made up in the near future) of several components, including a wallet application, a bank application, and an e-commerce application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo link&lt;/strong&gt; - &lt;a href="https://github.com/interledger/testnet"&gt;https://github.com/interledger/testnet&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Contribution guide&lt;/strong&gt; - &lt;a href="https://github.com/interledger/testnet/blob/main/.github/contributing.md"&gt;https://github.com/interledger/testnet/blob/main/.github/contributing.md&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Helm charts
&lt;/h3&gt;

&lt;p&gt;This is a Helm Charts repository for Interledger Kubernetes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo link&lt;/strong&gt; - &lt;a href="https://github.com/interledger/helm-charts"&gt;https://github.com/interledger/helm-charts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and many more on &lt;a href="https://github.com/interledger"&gt;Interledger repositories&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in It for You? 🎁
&lt;/h2&gt;

&lt;p&gt;As a Hacktoberfest contributor at Interledger, you will receive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The opportunity and satisfaction of contributing to the next big thing in the Open and Inclusive finance systems space.&lt;/li&gt;
&lt;li&gt;An opportunity to collaborate with and learn from like-minded and passionate individuals at Interledger.&lt;/li&gt;
&lt;li&gt;Grab a cool T-shirt 🎽 for contributing 1 or more accepted pull requests(First 150 contributors), and score exclusive, limited-edition swag for making 4 or more accepted pull requests(First 10 contributors)!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hacktoberfest is an opportunity to connect, collaborate, and create change through open-source contributions. Join Interledger on this exciting journey, and let's work together to build a more inclusive and interconnected financial future.&lt;/p&gt;

&lt;p&gt;Head over to our &lt;code&gt;#Hacktoberfest&lt;/code&gt; channel on our &lt;a href="https://communityinviter.com/apps/interledger/interledger-working-groups-slack"&gt;Slack&lt;/a&gt; if you still have any other questions or doubts.📢&lt;/p&gt;

&lt;p&gt;We can't wait to see the incredible contributions you'll make. Happy Hacktoberfest! 🚀🌟🎉&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>beginners</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Git Hacks for Hacktoberfest: A Quick and Easy Guide</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Tue, 26 Sep 2023 05:33:02 +0000</pubDate>
      <link>https://forem.com/devcer/git-hacks-for-hacktoberfest-a-quick-and-easy-guide-4cc0</link>
      <guid>https://forem.com/devcer/git-hacks-for-hacktoberfest-a-quick-and-easy-guide-4cc0</guid>
      <description>&lt;p&gt;Hacktoberfest is just around the corner, and for many, it serves as a gateway to dive into the world of open source. I personally started my Open Source journey through Hacktoberfest back in 2015, and I've found that mastering Git and managing it efficiently can significantly enhance your Open Source contributions. 🌟&lt;/p&gt;

&lt;p&gt;There is no one-size-fits-all approach to this; everyone has their preferred methods that work best for them. &lt;/p&gt;

&lt;p&gt;In this post, I'd like to share a straightforward approach that has helped me streamline my Open Source work, using &lt;a href="https://github.com/interledger/rafiki"&gt;Rafiki&lt;/a&gt; as an example for commands and code. 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing GitHub Remotes 🌐
&lt;/h2&gt;

&lt;p&gt;GitHub Remote is the link that connects your local Git repository to the GitHub repository. Throughout your contribution journey, you'll be pulling code from the remote and pushing your changes to it. Here are a few tips for managing your &lt;code&gt;remote&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Clone the Repository from Its Origin:
&lt;/h3&gt;

&lt;p&gt;When you clone the repository, make sure it's from its original source and not your fork. Your &lt;code&gt;origin&lt;/code&gt; remote should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   origin   https://github.com/interledger/rafiki.git (fetch)
   origin   https://github.com/interledger/rafiki.git (push)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Fork the Repository and Add it as a Remote:
&lt;/h3&gt;

&lt;p&gt;After cloning, fork the repository and add your fork as a remote. Keep the remote name simple; &lt;code&gt;fork&lt;/code&gt; works perfectly. It's only four letters, making it easy to remember and type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git remote add fork https://github.com/devcer/rafiki
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here &lt;code&gt;devcer&lt;/code&gt; is my GitHub username.&lt;/p&gt;

&lt;p&gt;Now your remote should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git remote -v
fork    https://github.com/devcer/rafiki.git (fetch)
fork    https://github.com/devcer/rafiki.git (push)
origin  https://github.com/interledger/rafiki.git (fetch)
origin  https://github.com/interledger/rafiki.git (push)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Contributing to Any Repository 🌱
&lt;/h2&gt;

&lt;p&gt;As a contributor, you typically won't have direct access to push your branch to the repository. To contribute effectively, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone the repository:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git clone https://github.com/interledger/rafiki.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Fork the repository:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NJgre4SI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/287lpwoe62t7y9lwrrgv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NJgre4SI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/287lpwoe62t7y9lwrrgv.png" alt="Fork" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add your fork as a remote on your local repository:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git remote add fork https://github.com/devcer/rafiki
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(Replace &lt;code&gt;devcer&lt;/code&gt; with your username.)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create and switch to your branch:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git checkout -b feat/new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Make your changes. 🛠️&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Push your branch to your fork:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git push fork feat/new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Submit a pull request from your fork using the GitHub interface. 📤&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Need to pull the latest updates from the &lt;code&gt;origin&lt;/code&gt; remote?&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Want to update your &lt;code&gt;fork&lt;/code&gt; remote from your local repository?
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   git push fork main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While some of the activities mentioned above can be performed directly using the GitHub user interface, where's the fun in that, right? Just kidding! Working with Git via the terminal provides you with a deeper understanding of how Git operates. Even if you can't remember all the commands, you'll still have a solid grasp of Git and the ability to figure out any command you want to use.&lt;/p&gt;

&lt;p&gt;By following these steps, you can smoothly navigate the world of open source and contribute effectively during Hacktoberfest and beyond. Happy coding! 💻🔧&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>beginners</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>10 must-read guides for Open Payments and Web Monetization Enthusiasts</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sun, 06 Nov 2022 07:54:39 +0000</pubDate>
      <link>https://forem.com/devcer/10-must-read-guides-for-open-payments-and-web-monetization-enthusiasts-c5a</link>
      <guid>https://forem.com/devcer/10-must-read-guides-for-open-payments-and-web-monetization-enthusiasts-c5a</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9MTMcK8D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eagyvnd4ortc24srfc5v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9MTMcK8D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eagyvnd4ortc24srfc5v.jpg" alt="Photo by Christine Roy on Unsplash" width="880" height="589"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open Payments&lt;/strong&gt; allows for seamless, secure, effortless payments over the web. The payments could be inter-wallet, cross-currency, and skips a few or all intermediaries in between the sender and the receiver.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web Monetization&lt;/strong&gt; is a new way to fund the open web. It allows people to make small, regular payments to the websites they visit, without the need for a third-party service. The payments are sent directly from the user's browser to the website's owner and can be used to fund anything from content to access to exclusive features.&lt;/p&gt;

&lt;p&gt;Open payments are already making it to the mainstream and it is something that is exciting for Web engineers. I'm a grantee and will be participating in &lt;strong&gt;ILP Summit 2022&lt;/strong&gt; in a few days. I have compiled a list of guides and websites that helped me understand the next big thing in the world of open payments over the past few months.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. [Proposal] Web Monetization - A new Revenue Model for the Web
&lt;/h2&gt;

&lt;p&gt;One of the discussions on the proposal for the new revenue model for the web.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://discourse.wicg.io/t/proposal-web-monetization-a-new-revenue-model-for-the-web/3785" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--7GsrsETd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://discourse.wicg.io/uploads/default/original/2X/a/a288a739a232c851093e1609f65b40a05b3ed913.png" height="207" class="m-0" width="192"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://discourse.wicg.io/t/proposal-web-monetization-a-new-revenue-model-for-the-web/3785" rel="noopener noreferrer" class="c-link"&gt;
          [Proposal] Web Monetization - A new Revenue Model for the Web - APIs - WICG
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          (UPDATED: 5 Sept 2019)  An API that allows Websites to request a stream of very small payments from the user.  Web Monetization is an alternative revenue model for the Web. It allows Websites to earn revenue from users without:   Requiring users to sign-up to a subscription Needing to deliver content/services through 3rd-party platforms Advertising  For a more detailed description, see the Explainer and track design discussion in the issue log.  There is also an early Specification, which is obv...
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--55-CJocY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://discourse.wicg.io/uploads/default/optimized/1X/3117672ec1ba702ff74a222a3def046d2d69d61e_2_32x32.ico" width="32" height="32"&gt;
        discourse.wicg.io
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  2. Interledger
&lt;/h2&gt;

&lt;p&gt;Interledger, is a payment messaging protocol that supports payments of any size, including micropayments. It allows payments to be aggregated and settled over existing payment networks, such as financial institutions and Visa/Mastercard. Web Monetization providers and receivers use Interledger to exchange payments.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://interledger.org/" rel="noopener noreferrer"&gt;
      interledger.org
    &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  3. Web Payments at W3C
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.w3.org/Payments/" rel="noopener noreferrer"&gt;
      w3.org
    &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  4. Web Monetization Specification
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://webmonetization.org/specification.html" rel="noopener noreferrer"&gt;
      webmonetization.org
    &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  5. Web Monetization Explainer
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://webmonetization.org/docs/explainer/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--thmQB95s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://webmonetization.org/assets/images/flow-07353206fa1962c7dd815bc5adc221d0.svg" height="478" class="m-0" width="880"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://webmonetization.org/docs/explainer/" rel="noopener noreferrer" class="c-link"&gt;
          Web Monetization Explainer | Web Monetization
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Web Monetization (WM) is a proposed API standard that allows websites to request
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ARjR3w70--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://webmonetization.org/img/fav-webmonetization.png" width="32" height="32"&gt;
        webmonetization.org
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  6. Payment Pointers
&lt;/h2&gt;

&lt;p&gt;Payment Pointers are a standardized identifier for payment accounts, just like email id for sending emails. This is an explainer on everything you need to know about Payment pointers.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://paymentpointers.org/" rel="noopener noreferrer" class="c-link"&gt;
          Explainer - Payment PointersExplainer | Payment Pointers
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Payment Pointers are a standardized identifier for payment accounts.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--WPD2WZYh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://paymentpointers.org/favicon.ico" width="" height=""&gt;
        paymentpointers.org
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  7. Rafiki.dev
&lt;/h2&gt;

&lt;p&gt;Rafiki is an open-source software package that provides access to a wide range of Interledger APIs. It is designed to be used by wallet providers, enabling them to offer Interledger functionality to their customers.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://rafiki.dev/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--BoA8TtHT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rafiki.dev/img/logo.svg" height="30" class="m-0" width="119"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://rafiki.dev/" rel="noopener noreferrer" class="c-link"&gt;
          Hello from Rafiki Documentation | Rafiki Documentation
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Documentation for Interledger's Rafiki
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--dNEdEUBd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rafiki.dev/img/favicon.ico" width="188" height="212"&gt;
        rafiki.dev
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  8. How to Web Monetize your Content and Support Creators Online with Micropayments
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.caseorganic.com/posts/how-to-web-monetize-your-content-and-support-creators-online-with-micropayments" rel="noopener noreferrer"&gt;
      caseorganic.com
    &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  9. Open Payments
&lt;/h2&gt;

&lt;p&gt;An API standard that can be implemented by any account servicing entity such as digital wallets, banks, crypto-wallets, and mobile money providers.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://docs.openpayments.guide/" rel="noopener noreferrer"&gt;
      docs.openpayments.guide
    &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  10. Coil.com
&lt;/h2&gt;

&lt;p&gt;Coil is a Web Monetization provider that provides its members access to web-monetized content.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://developers.coil.com/" rel="noopener noreferrer"&gt;
      developers.coil.com
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Came across any other interesting reads? Share it in the comments.&lt;/p&gt;

&lt;p&gt;This content is web monetized on dev.to  🙌  Show me some love. ❤️&lt;/p&gt;

</description>
      <category>payments</category>
      <category>webmonetization</category>
      <category>webdev</category>
      <category>ilpsummit22</category>
    </item>
    <item>
      <title>Reiterating why you should never use Array ‘index’ as ‘key’ in your React Applications</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Thu, 06 Oct 2022 19:27:18 +0000</pubDate>
      <link>https://forem.com/devcer/why-you-should-never-use-array-index-as-key-prop-in-your-react-applications-3m9o</link>
      <guid>https://forem.com/devcer/why-you-should-never-use-array-index-as-key-prop-in-your-react-applications-3m9o</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AcC9PQ00bv1_1CePwcttLhg.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AcC9PQ00bv1_1CePwcttLhg.jpeg" alt="reactjs"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by RealToughCandy.com&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I know you might have heard about passing mandatory key prop in your iterators a lot before, but let's look at it again with an example of a super weird bug 🐞 I found in my code recently.&lt;/p&gt;

&lt;p&gt;Imagine you are writing your React code to render a list of items using Array.prototye.map that returns a list of components. If you are working in a Repo with proper eslint setup then you might have got a warning related to react/jsx-key , which means key prop is missing inside your iterator. If you are aware of the rule react/no-array-index-key then you will probably set a unique value to your key prop, else you end up putting the arrayindex as the key prop without understanding the consequences.&lt;/p&gt;

&lt;p&gt;Let's look at an example of these two approaches(Using array index and unique id) and reproduce the weird bug that I faced in my code last week. Below is a React codesandbox with the sample of two tables. Both the table components are exactly the same with the same data. The only difference being one table is rendered with array index as key and the other one with a unique id. Additionally, a user can also delete a product row from the table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/media/e99850d39052f87cf29026ef37e6449e/href" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://medium.com/media/e99850d39052f87cf29026ef37e6449e/href" rel="noopener noreferrer"&gt;https://medium.com/media/e99850d39052f87cf29026ef37e6449e/href&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's try to delete a row in the first table. As soon as you click on theDelete button, the text changes to Deleting... , and the row gets deleted after 3 seconds. However, the button in the next row gets updated toDeleting... , which is weird because we didn’t update it.&lt;/p&gt;

&lt;p&gt;However, if you do the same action on the second table, it works perfectly. The only difference between these two tables is the first table rows are rendered with key prop as the index of the products list and the second table rows are rendered with key prop as the id of the product from the products list.&lt;/p&gt;

&lt;h4&gt;
  
  
  Did we fix the bug?
&lt;/h4&gt;

&lt;p&gt;It was weird at first as we were unable to figure out the root cause of the issue. We were thinking of fixing it with a different set of approaches. But once we figured out the actual issue that the key is index by default, it was an easy fix. 🎉&lt;/p&gt;

&lt;h4&gt;
  
  
  Why didn’t my eslint catch this error?
&lt;/h4&gt;

&lt;p&gt;Because, it is not from the code that we wrote. the issue was from a &lt;a href="https://github.com/frontend-collective/react-sortable-tree" rel="noopener noreferrer"&gt;library&lt;/a&gt; I use, that sets the default key prop to the index in its iterable. 💭&lt;/p&gt;

&lt;p&gt;Apart from this, there are other benefits such as performance optimization if data keeps changing after it is rendered. Keys help React identify which items have changed, are added, or are removed. So it is highly recommended to use unique identifiers as a key prop inside an iterable.&lt;/p&gt;

&lt;p&gt;To read more about keys , Click &lt;a href="https://reactjs.org/docs/lists-and-keys.html#keys" rel="noopener noreferrer"&gt;here&lt;/a&gt;. ⬅️&lt;/p&gt;

&lt;p&gt;If your React project doesn’t have the eslint rules react/no-array-index-key ,react/jsx-key enabled, I would highly recommend you enable them right away to avoid any such related UI bugs in the future.&lt;/p&gt;

&lt;p&gt;For more information on the other eslint rules that can make you a better developer. Read &lt;a href="https://dev.to/devcer/eslint-rules-that-made-me-a-better-react-developer-192k"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope this was helpful.&lt;/p&gt;

&lt;p&gt;📚 Resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/lists-and-keys.html#keys" rel="noopener noreferrer"&gt;https://reactjs.org/docs/lists-and-keys.html#keys&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/" rel="noopener noreferrer"&gt;https://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md" rel="noopener noreferrer"&gt;https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md" rel="noopener noreferrer"&gt;https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/devcer/eslint-rules-that-made-me-a-better-react-developer-192k"&gt;https://isantoshv.medium.com/eslint-rules-that-made-me-a-better-react-developer-7689f0cb443a&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>bugs</category>
      <category>javascript</category>
      <category>arrays</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Document fragment — The lesser known superpower of Javascript</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sun, 08 May 2022 08:48:13 +0000</pubDate>
      <link>https://forem.com/devcer/document-fragment-the-lesser-known-superpower-of-javascript-38ch</link>
      <guid>https://forem.com/devcer/document-fragment-the-lesser-known-superpower-of-javascript-38ch</guid>
      <description>&lt;h3&gt;
  
  
  Document fragment — The lesser known superpower of Javascript
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vgNkDMED--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AYwCBpXCOHpMyUwoZ5i70TQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vgNkDMED--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AYwCBpXCOHpMyUwoZ5i70TQ.jpeg" alt="" width="880" height="550"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Pankaj Patel on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Page speed of our websites is important. A faster website will more likely improve the conversion rate and search engine rankings of the website. Even though your website has great user experience, it would still mean less if your website is super slow. Walmart once mentioned that every 1 second improvement in their website speed led to a 2% increase in their conversions. There are several such examples from many technology companies that co-relates Web Performance to Business Performance. 💸&lt;/p&gt;

&lt;p&gt;If your app becomes sluggish and you suspect it to be the code, then it is most likely the HTML that is slowing it down or the DOM manipulations from your JS Code. Even in the web apps built using the most modern frameworks like React, it is most likely the unsafe handling of component re-renders that is making your app slower. &lt;a href="https://emojipedia.org/snail/"&gt;🐌&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Changing actual DOM is an expensive operation and one of the reason modern frameworks use Virtual DOM is to make these operations less expensive with better change detection cycles and diffing algorithms. &lt;strong&gt;Document fragment&lt;/strong&gt; is one such interface that we can use in vanilla JS to improve the performance of our DOM operations in an application. Document fragment is a fragment of the Document object and is not the part of the actual DOM. Using document fragment effectively will reduce the interactions with actual DOM, thus improving your app performance.&lt;/p&gt;

&lt;h4&gt;
  
  
  Lets talk numbers… 🤖
&lt;/h4&gt;

&lt;p&gt;I have performed a jsbench test and added 10000 list items dynamically with and without document fragment. You can clearly see how the same code is faster when using document fragment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S6QWCPf---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADhjuUZC9tI_iKWMS_bMLlA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S6QWCPf---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADhjuUZC9tI_iKWMS_bMLlA.png" alt="" width="880" height="357"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;jsbench stats&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  So, what is the difference?
&lt;/h4&gt;

&lt;p&gt;In the first approach, you are accessing the actual DOM object(list) only once to add a fragment of DOM to it, however in the second snippet, you are changing actual DOM(list) 10,000 times and that makes this approach slower. 🐢&lt;/p&gt;

&lt;p&gt;Inclusion of this simple concept does wonders in your application if it involves DOM heavy operations in your code, and Document fragment was rarely/never used in all the code bases I have seen until now. Thus, it has been a secret superpower of JavaScript for me that not many developers use even today.&lt;/p&gt;

&lt;h4&gt;
  
  
  References:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;MDN&lt;/strong&gt;  — &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment#browser_compatibility"&gt;https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Browser compatibility&lt;/strong&gt;  — &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment#browser_compatibility"&gt;https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment#browser_compatibility&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>html</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>ESLint rules that made me a better React developer</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Fri, 08 Apr 2022 16:54:25 +0000</pubDate>
      <link>https://forem.com/devcer/eslint-rules-that-made-me-a-better-react-developer-192k</link>
      <guid>https://forem.com/devcer/eslint-rules-that-made-me-a-better-react-developer-192k</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Auib9RKW-eSBItHAsVAH6LQ.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Auib9RKW-eSBItHAsVAH6LQ.jpeg" alt="ESLint rules that made me a better React developer"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Lautaro Andreani on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have been writing React code for about 15 months now and it has been an exciting journey where I get to learn new and better things around React even today.&lt;/p&gt;

&lt;p&gt;Failing fast is something I personally value, and recommend fellow developers all the time. Having static code analysis in your repository will help you write cleaner code, find bugs earlier and reduce your overall cost overhead. 💸&lt;/p&gt;

&lt;p&gt;Here, I listed out few ESLint rules we use in our repo at &lt;a href="https://heymarvin.com/" rel="noopener noreferrer"&gt;Marvin&lt;/a&gt;, that has been very helpful for us in writing secure, cleaner, bug free and maintainable code with better performance. 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  Security 🛡️
&lt;/h3&gt;

&lt;h4&gt;
  
  
  react/no-danger
&lt;/h4&gt;

&lt;p&gt;This rule prevents you from writing insecure code. For example, this rule will throw an error if you dangerously set HTML without sanitising the input. More details &lt;a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-no-target-blank
&lt;/h4&gt;

&lt;p&gt;This rule prevents you to add hyperlinks without creating security vulnerabilities. Your new window that the hyperlink opens can still have reference to the old window object. More details &lt;a href="https://html.spec.whatwg.org/multipage/links.html#link-type-noopener" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-no-script-url
&lt;/h4&gt;

&lt;p&gt;Prevents you from opening up a dangerous security loophole as this can execute any unsanitised code. More details &lt;a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maintainability 📒
&lt;/h3&gt;

&lt;h4&gt;
  
  
  prefer-spread and react/destructuring-assignment
&lt;/h4&gt;

&lt;p&gt;This rule has been very helpful while cleaning up code and updating components. It becomes easy to find redundant prop variables or variables in general and clean the code when restructuring. More details &lt;a href="https://eslint.org/docs/rules/prefer-spread" rel="noopener noreferrer"&gt;here&lt;/a&gt; and &lt;a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-props-no-spreading
&lt;/h4&gt;

&lt;p&gt;This rule makes sure that you know exactly what props are passed to the child component, thus making sure you won’t pass any redundant props to your components. This would in turn reduce the number of re-renders in the component. More details &lt;a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clean Code 🧹
&lt;/h3&gt;

&lt;h4&gt;
  
  
  react-hooks/exhaustive-deps
&lt;/h4&gt;

&lt;p&gt;This rule avoids a lot of bugs that might occur because of the hooks that we write without passing proper and required dependencies.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/default-props-match-prop-types
&lt;/h4&gt;

&lt;p&gt;Very helpful if you are trying to inculcate writing modular and reusable code across the application.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/no-unused-prop-types and react/no-unused-class-component-methods
&lt;/h4&gt;

&lt;p&gt;Helps you in cleaning up redundant props and component methods that are not being used in your code anymore.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/no-unknown-property
&lt;/h4&gt;

&lt;p&gt;This has been mostly helpful when I use class instead of className in my code even after 15 months of writing React every day. 🥲&lt;/p&gt;

&lt;h4&gt;
  
  
  react/sort-prop-types
&lt;/h4&gt;

&lt;p&gt;Every developer who writes code will have his own priority of passing props in a component. This gets complicated with time and on onboarding new developers. But one thing that is constant for all developers is the alphabetical order. This rule will make sure that developers structure and maintain props on components using a single alphabetical order.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-curly-brace-presence
&lt;/h4&gt;

&lt;p&gt;Using both jsx expressions and javascript string literals will make simple things complex while writing code, at least in the initial days until you get a grip of using both in React. This rule would help you to quickly figure out bugs, incorrect code, unnecessary braces and helps you to simplify your code. More details &lt;a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-curly-newline
&lt;/h4&gt;

&lt;p&gt;Helps you to structure and write cleaner code&lt;/p&gt;

&lt;h4&gt;
  
  
  promise/always-return
&lt;/h4&gt;

&lt;p&gt;This rule has not only helped us to write cleaner code but also safely and properly handling asynchronous code in our react application. More details &lt;a href="https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/always-return.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance 🚅
&lt;/h3&gt;

&lt;h4&gt;
  
  
  react/no-array-index-key
&lt;/h4&gt;

&lt;p&gt;If an array item is added at the beginning of the array then using the index as a key will re-render all the items in the array. This rule prevents us from using the array index as a key. Learn more about React keys &lt;a href="https://reactjs.org/docs/lists-and-keys.html#keys" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-key
&lt;/h4&gt;

&lt;p&gt;Keys in React identify which items in a list are changed, updated, or deleted. This rule detects if a key is needed for an element. You can learn why a key is needed from &lt;a href="https://reactjs.org/docs/reconciliation.html#recursing-on-children" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  react/jsx-no-constructed-context-values
&lt;/h4&gt;

&lt;p&gt;This rule prevents unnecessary re-renders by suggesting us what all variables can be memoized in our application. Initially I often used useEffect and useState and wasn’t aware of useMemoor how to use it. but once I learnt how to memoize my variables, I was able to prevent a number of re-renders throughout my application. You can find more details in &lt;a href="https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These are some of the ESLint rules that we have enabled in our repo to write cleaner, maintainable, secure and bug-free code with better performance.&lt;/p&gt;

&lt;p&gt;Know any other rules that could help write better react code? Comment below and help your fellow React developers. 🙌&lt;/p&gt;

</description>
      <category>programming</category>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Notion like Placeholders for every line — Slatejs</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Fri, 17 Sep 2021 18:59:47 +0000</pubDate>
      <link>https://forem.com/devcer/notion-like-placeholders-for-every-line-slatejs-4hoh</link>
      <guid>https://forem.com/devcer/notion-like-placeholders-for-every-line-slatejs-4hoh</guid>
      <description>&lt;h3&gt;
  
  
  Notion like Placeholders for every line — Slatejs
&lt;/h3&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AtHhrhRPimSXMwdZceaVQPA.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AtHhrhRPimSXMwdZceaVQPA.jpeg" alt="Notepad"&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@diana_pole?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Diana Polekhina&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/notepad?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have recently worked on building a module that includes a google docs kind of functionality. I was exploring several JavaScript frameworks around building editors, and I finally choosed Slatejs&lt;/p&gt;

&lt;p&gt;One feature of my editor was to have a placeholder for every line similar to Notion. By default, Slatejs provides a placeholder but it will be rendered if the document only contains a single empty block.&lt;/p&gt;

&lt;p&gt;However, Slate.js doesn’t have the feature that I needed. I was able to figure out a solution with the help of the amazing Slate.js community members and thought to share this with you.&lt;/p&gt;

&lt;p&gt;The solution I implemented was to check if a node is empty and then display a dummy text using CSS tricks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.selected-empty-element {
  position: relative;
}

.selected-empty-element:after {
  content: " Use '/' to create question";
  color: #aaa;
  position: absolute;
  top: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the render element method, I will add this class selected-empty-element if the node is empty.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Element = (props): JSX.Element =&amp;gt; {
  const { children } = props;
  const isEmpty =
    children.props.node.children[0].text === “” &amp;amp;&amp;amp;
    children.props.node.children.length === 1;

  return (
    &amp;lt;p {…props} className={isEmpty ? “selected-empty-element” : “”}&amp;gt;
      {children}
    &amp;lt;/p&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But this gives out a weird user experience when you have multiple empty rows. All empty lines will show the placeholders.&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%2Fcdn-images-1.medium.com%2Fmax%2F650%2F1%2AuCvAksHe2bL7RXClGxq4LA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F650%2F1%2AuCvAksHe2bL7RXClGxq4LA.gif" alt="Multiple empty rows in editor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So one solution I could think of was to check if that particular line has focus. I added a check using useSelected, and it looked exactly like the solution I needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const selected = useSelected();
return (
  &amp;lt;p {...props} 
    className={selected &amp;amp;&amp;amp; isEmpty ? "selected-empty-element" : ""}
  &amp;gt;
    {children}
  &amp;lt;/p&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fcdn-images-1.medium.com%2Fmax%2F653%2F1%2A4XC3VH53nJ8oiJ0MaPUiJA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F653%2F1%2A4XC3VH53nJ8oiJ0MaPUiJA.gif" alt="placeholder only on selection"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, there was one problem that I found later on. If I select the whole document, then the useSelected is true for all nodes and I could see the placeholder for all nodes.&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%2Fcdn-images-1.medium.com%2Fmax%2F650%2F1%2ANrfKd0ONnbV5mGXOtAr_ZQ.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F650%2F1%2ANrfKd0ONnbV5mGXOtAr_ZQ.gif" alt="the whole document is selected"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I had to add another check to see if my selection is empty or not. I used the available library methods to see if the Range is collapsed or not using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const editor = useSlate();
const selection = editor.selection;
let isSelectionCollapsed = true;
if (selection !== null)
 isSelectionCollapsed = Range.isCollapsed(editor.selection);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now the final Element code is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Element = (props): JSX.Element =&amp;gt; {
  const { children } = props;
  const selected = useSelected();
  const editor = useSlate();
  const selection = editor.selection;
  let isSelectionCollapsed = true;
  if (selection !== null)
    isSelectionCollapsed = Range.isCollapsed(editor.selection);

  const isEmpty =
    children.props.node.children[0].text === “” &amp;amp;&amp;amp;
    children.props.node.children.length === 1;

  return (
    &amp;lt;p {…props}
      className={ selected &amp;amp;&amp;amp; isSelectionCollapsed &amp;amp;&amp;amp; isEmpty
        ? “selected-empty-element” : “”
      }
    &amp;gt;
      {children}
    &amp;lt;/p&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was the final solution that I needed. You can find the complete editor code in this sandbox here -&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/r69jf"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I hope this was helpful. Share with me some of the interesting features you built using Slatejs.&lt;/p&gt;

</description>
      <category>slatejs</category>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Deleting a property from a Javascript Object without Mutation</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sun, 18 Jul 2021 08:16:50 +0000</pubDate>
      <link>https://forem.com/devcer/deleting-a-property-from-a-javascript-object-without-mutation-3g4</link>
      <guid>https://forem.com/devcer/deleting-a-property-from-a-javascript-object-without-mutation-3g4</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xicNTL1A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AlSbm5so0zwaSZFwh0BlXfg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xicNTL1A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AlSbm5so0zwaSZFwh0BlXfg.jpeg" alt="Banner image"&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@oskaryil?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Oskar Yildiz&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/javascript?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey everyone 👋🏻,&lt;/p&gt;

&lt;p&gt;There are multiple approaches to do the same operation in Javascript. Every approach has its own pro’s and con’s and there is always better way to do a particular operation in Javascript. In this article, let us see how to properly delete a property in Javascript without mutating an object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Mutating Objects is bad idea?
&lt;/h3&gt;

&lt;p&gt;We end up running into hard-to-debug and completely avoidable issues if we keep mutating objects in Javascript. The object might have correct value somewhere but will be different at other place and we would have no idea what changed what.&lt;/p&gt;

&lt;p&gt;So it is highly recommended to perform CRUD operations on Javascript objects without mutating the objects. Take a look at this &lt;a href="https://blog.sapegin.me/all/avoid-mutation/"&gt;post&lt;/a&gt; to understand more about why it is recommended to avoid mutating Javascript objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using &lt;code&gt;delete&lt;/code&gt; keyword
&lt;/h3&gt;

&lt;p&gt;Consider the below object,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  firstName: "Tony",
  lastName: "Stark",
  team: "avengers",
  worth: "billions",
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so if you want to delete a key from the person object then one way to do this is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delete person.worth; 
console.log(person); 

or

delete person['worth'];
console.log(person);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although delete can be used to delete a property, you end up mutating the object which can cause undetectable bugs later on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alternative approach
&lt;/h3&gt;

&lt;p&gt;A better way to delete a property without mutating is by using spread operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const {worth, …newPerson} = person;
console.log(newPerson);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of mutating the original object, you create a new object and use it instead. If your object is a nested one then you may have to handle accordingly as using spread operator doesn’t perform a deep clone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus
&lt;/h3&gt;

&lt;p&gt;Want to delete an object from an Array without mutating the Array?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const people = [
{ id: 1, name: 'ninja' },
{ id: 2, name: 'darkknight' },
{ id: 3, name: 'dexter' }
...
];

const updatedPeople = people.filter(person =&amp;gt; person.id !== 2);
console.log(updatedPeople); 
// [
// { id: 1, name: 'ninja' },
// { id: 3, name: 'dexter' }
// ...
// ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The updatedPeoplewill no longer have the person object with id 2.&lt;/p&gt;

&lt;p&gt;Are there any other alternative and better approaches that you follow in your code? Share it with me in the comments.&lt;/p&gt;

</description>
      <category>objects</category>
      <category>coding</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Log all Prime Numbers till `n` using Javascript Generators</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sat, 13 Feb 2021 15:26:05 +0000</pubDate>
      <link>https://forem.com/devcer/log-all-prime-numbers-until-n-using-javascript-generators-121e</link>
      <guid>https://forem.com/devcer/log-all-prime-numbers-until-n-using-javascript-generators-121e</guid>
      <description>&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A6H1M7BTSwWE2YtFYrCD_MQ.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A6H1M7BTSwWE2YtFYrCD_MQ.jpeg"&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@fredmarriage?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;freddie marriage&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/infinity?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was interviewing with few companies a couple of months back for a Frontend/Fullstack position. One of the most interesting questions I faced in one of the coding exams was to &lt;code&gt;Write a function in JavaScript that takes an input 'n' and return all the prime numbers until 'n'&lt;/code&gt;. The question is simple and straight forward as you see it.&lt;/p&gt;

&lt;p&gt;I quickly wrote the following code and it worked perfectly!&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;BOOM! I’m done. I felt happy and ran the test cases. Of course, they failed. &lt;em&gt;Happiness is a myth in Javascript&lt;/em&gt;. There was a trick here and this was the provided main method that calls my function…&lt;/p&gt;

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

function main() {
  const primeNumberGenerator = getAllPrimeNumbers(23);
  let primeNumber;
  while ((primeNumber = primeNumberGenerator.next().value) !== undefined) {
    console.log(primeNumber);
  }
}


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

&lt;/div&gt;
&lt;p&gt;I observed some new keywords like &lt;code&gt;next()&lt;/code&gt;, I remember to have seen something similar to this in &lt;code&gt;RxJS&lt;/code&gt; but this was a pure Javascript code so this should mean something different. I googled and found something new in Javascript that I have rarely used/heard before - &lt;code&gt;Generators in Javascript&lt;/code&gt;. It was a timed test, so I quickly read through articles, examples and fixed my code.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;It worked and all tests passed!&lt;/p&gt;

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

Generators can return (“yield”) multiple values, one after another, on-demand. They work great with [iterables](https://javascript.info/iterable), allowing to create data streams with ease.


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

&lt;/div&gt;

&lt;p&gt;I don’t want to talk more about generators as there are better articles that do this. I have attached a few at the end that helped me in this course of learning.&lt;/p&gt;

&lt;p&gt;This was one of the most interesting things I got to solve as part of the interviews. I wrote code to solve a simple problem but with lazy evaluation and memory efficiency. This was fun.&lt;/p&gt;

&lt;p&gt;Few Articles that helped me to quickly understand Generators and Iterators -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://javascript.info/generators" rel="noopener noreferrer"&gt;https://javascript.info/generators&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codeburst.io/understanding-generators-in-es6-javascript-with-examples-6728834016d5" rel="noopener noreferrer"&gt;https://codeburst.io/understanding-generators-in-es6-javascript-with-examples-6728834016d5&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this was helpful to you to explore how we can use generators in our everyday code.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Why and How we moved away from jQuery in our Web Application</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sun, 13 Sep 2020 16:38:14 +0000</pubDate>
      <link>https://forem.com/devcer/why-and-how-i-moved-away-from-jquery-in-my-web-application-2of2</link>
      <guid>https://forem.com/devcer/why-and-how-i-moved-away-from-jquery-in-my-web-application-2of2</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W1pzehm0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AhaMEQHfMceoIpoEs30wzuA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W1pzehm0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AhaMEQHfMceoIpoEs30wzuA.jpeg" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@grakozy?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Greg Rakozy&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/jquery?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I got into working on a half a decade old web application and recently we started revamping our codebase to improve the performance of our App. We were trying out a few things to make things simple and removing jQuery as a dependency was one of that.&lt;/p&gt;

&lt;p&gt;There are a ton of articles out there to help you choose if you should use jquery or not so I’m not going to talk about that(attached a few articles at the end of this article). I will instead mention the reason why we personally decided to move away from jQuery and how we updated a few of the jQuery snippets to Vanilla JS snippets in our codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why did we decide to move away from jQuery?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Firstly, we included jQuery for developer convenience and a lot has changed in the JS ecosystem in the past few years and honestly, we realized we could conveniently do almost everything in JavaScript now.&lt;/li&gt;
&lt;li&gt;We don’t have to load a ~87kb file/code anymore in our project&lt;/li&gt;
&lt;li&gt;Basic statements like selectors, event handlers, setters/getters can be written with vanilla JS. So instead of my library internally calling these basic methods, I can call them myself.&lt;/li&gt;
&lt;li&gt;There is less scope to run into cross-browser compatability issues now, which was another main reason to use jQuery in the first place for many developers. So this benefit doesn’t apply anymore.&lt;/li&gt;
&lt;li&gt;CSS3 Animations have far better performance than jQuery effects as CSS3 Animations run on a different thread than JavaScript in a web application. Try this out — &lt;a href="https://greensock.com/js/speed.html"&gt;https://greensock.com/js/speed.html&lt;/a&gt; to compare the performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These reasons have strongly convinced us that we could unplug jQuery from our codebase and so we did it.&lt;/p&gt;

&lt;p&gt;Below are a few jQuery methods that we have commonly used in our codebase. jQuery team is kind enough to list out the JavaScript alternatives to their jQuery methods in their documentation itself, so it wasn’t much of a challenge to move away from jQuery. I have also provided the alternative JavaScript code we used for every statement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; These code-snippets are specific to our page design and code structure. They might differ depending on your codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Selectors
&lt;/h3&gt;

&lt;p&gt;We were extensively using class and id selectors to get DOM element references.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// jQuery
let searchBox = $(“.search-box”);
searchBox.on("keydown", () =&amp;gt;{
  // do something
});

// JavaScript
// we wanted the event listener only to the first text box anyway
let searchBox = document.getElementsByClassName("search-box")[0];
searchBox.addEventListener("keydown", () =&amp;gt; {
  // do something
}):
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;The .on we were using to attach events to any DOM Element is moved instead to .addEventListener. The code example in the above section is How we did it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Effects
&lt;/h3&gt;

&lt;p&gt;The .hide and .show methods we used to render after asynchronously getting data are with &lt;code&gt;display: none&lt;/code&gt; and &lt;code&gt;display: block&lt;/code&gt;. Well, there is a tradeoff that was acceptable to us, that is animation. we could use CSS animation for that but initially, we decided to hide/show using display style property as we could live without animation for now. Our default display property was &lt;code&gt;block&lt;/code&gt; for the container so this worked perfectly for us.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// jQuery
$("#results").hide(500); // to hide
$("#results").show(500); // to show

// JavaScript
document.getElementById("results").style.display = "none" // to hide
document.getElementById("results").style.display = "block" // to show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Getting and setting attributes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// jQuery
$("#result-link").attr("href");
$("#result-link").attr("href", "https://www.google.com");

// JavaScript
document.getElementById("result-link").getAttribute("href");
document.getElementById("result-link").setAttribute("href", "https://www.google.com");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Get/Set class names and styles
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// jQuery
$( "#results" ).hasClass( "show" ); 
$( "#results" ).addClass( "show" );
$( "#results" ).removeClass( "show" );
$( "#results" ).css({top: 0})


// JavaScript
document.getElementById("results").classList.includes("show");
document.getElementById("results").classList.add("show");
document.getElementById("results").classList.remove("show");
document.getElementById("results").style.top = 0;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  .ready()
&lt;/h3&gt;

&lt;p&gt;The JavaScript version of &lt;code&gt;.ready&lt;/code&gt; function is adding handler DOMContentLoaded to the DOM element. There is an in-depth answer on &lt;a href="https://stackoverflow.com/questions/9899372/pure-javascript-equivalent-of-jquerys-ready-how-to-call-a-function-when-t"&gt;StackOverflow&lt;/a&gt; but this is our initial workaround.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// jQuery
$(document).ready(function() {
  // Handler for .ready() called
});

// JavaScript
document.addEventListener("DOMContentLoaded", function() {
  // Handler for DOMContentLoaded
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although jQuery syntax looks simple and short, we live in a world with minifiers that will make sure no extra bytes will be delivered to the client machine using JavaScript.&lt;/p&gt;

&lt;p&gt;IMHO, Newbie Web Developers should take a look at jQuery at least once in their amateur phase. It personally helped me to gain conceptual knowledge of many in JavaScript and easily relate to them, eg: Event binding/unbinding, DOM parsing, etc. If you are using any of the modern frameworks like Angular, React, or Vue, then the developer convenience and cross-browser compatibility are already there so there is less scope that you will include jQuery in your application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Few articles you could read if you want to decide between To use or not to use jQuery&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hackernoon.com/does-jquery-sacrifice-performance-and-code-efficiency-468aa967ef04"&gt;https://hackernoon.com/does-jquery-sacrifice-performance-and-code-efficiency-468aa967ef04&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/javascript-in-plain-english/jquery-will-die-soon-heres-why-976a6b8105e1"&gt;https://medium.com/javascript-in-plain-english/jquery-will-die-soon-heres-why-976a6b8105e1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/rbazinet/you-might-not-need-jquery-286i-temp-slug-1683257"&gt;http://youmightnotneedjquery.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mmikowski.github.io/why-jquery/"&gt;https://mmikowski.github.io/why-jquery/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.opera.com/articles/css3-vs-jquery-animations/"&gt;https://dev.opera.com/articles/css3-vs-jquery-animations/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope this was helpful. Thank you for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>refactoring</category>
      <category>programming</category>
    </item>
    <item>
      <title>Optional Chaining — Using it already</title>
      <dc:creator>Santosh Viswanatham</dc:creator>
      <pubDate>Sat, 01 Feb 2020 08:29:01 +0000</pubDate>
      <link>https://forem.com/devcer/optional-chaining-using-it-already-3g9j</link>
      <guid>https://forem.com/devcer/optional-chaining-using-it-already-3g9j</guid>
      <description>&lt;h3&gt;
  
  
  Optional Chaining — Using it already
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Jet6wxa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Awj8H5GF7RBV-93RwUUNVCw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Jet6wxa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Awj8H5GF7RBV-93RwUUNVCw.jpeg" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/@floweichelt?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Florian Weichelt&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/chains?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typescript website defines Optional Chaining as&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;At its core, optional chaining lets us write code where Typescript can immediately stop running some expressions if we run into a &lt;em&gt;null&lt;/em&gt; or &lt;em&gt;undefined&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As JavaScript Developers we often get to work with deeply nested JSON objects, If the data is from a REST API then you are more likely depend on the Backend to ensure your response is in the format you are expecting, else we run into errors during runtime while executing expressions on those objects.&lt;/p&gt;

&lt;p&gt;consider the following example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  name: {
    first: {
      text: "Santosh"
    }
  },
  pets: ['cat', 'dog']
}

console.log(person.name.first.text.length); // logs the length of firstname
console.log(person.name.last.text.length); // throws an Error
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here in the second log, person.name.last is undefined and the expression tries to evaluate the text property of undefined which throws an error.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vLMhgb_6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ANYD-JFl2ZWxqSK8ddZt19g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vLMhgb_6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ANYD-JFl2ZWxqSK8ddZt19g.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To handle this case I usually do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(person &amp;amp;&amp;amp; person.name &amp;amp;&amp;amp; 
    person.name.last &amp;amp;&amp;amp; 
    person.name.last.text &amp;amp;&amp;amp; 
    person.name.last.text.length); // doesn't throw any error. logs undefined instead
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I check the child property before accessing it, yet it is kind of messy. With optional chaining coming into the picture, we can do this instead&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(person?.name?.last?.text.length); // logs undefined
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Pretty clean and simple, right? ⛓&lt;/p&gt;

&lt;p&gt;You can use this for arrays and functions as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(person.pets[3]); // throws an Error
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;with optional chaining, you can do a safe-check&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(person?.pets?.[3]); // doesn't throw an error, logs undefined instead
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Enabling Optional Chaining in Chrome 79+
&lt;/h3&gt;

&lt;p&gt;As per MDN, only Chrome 79+ and Opera 65+ have Experimental support for Optional chaining which has to be first enabled on the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In Chrome&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open the URL chrome://flags in your chrome browser&lt;/li&gt;
&lt;li&gt;Enable Experimental JavaScript flag from the available Experiments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p3SH5DHi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AP1usiQXT0PGgLoJ2ysgRMQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p3SH5DHi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AP1usiQXT0PGgLoJ2ysgRMQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Current Status&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Optional Chaining proposal has reached Stage 4(as of today, Jan 2020) of the TC39 process. 🙏&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The active status of the proposal can be found in this repo &lt;a href="https://github.com/tc39/proposal-optional-chaining"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring with Babel
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Babel enabled us to use next-gen JavaScript today, and there is already a babel plugin that you can install to start using Optional Chaining.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find the installation instructions &lt;a href="https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining#installation"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Internally Babel transpiles the following code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(person?.name?.last?.text.length);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var \_person$name, \_person$name$last;

console.log(person === null
  || person === void 0 ? void 0 : (\_person$name = person.name) === null
  || \_person$name === void 0 ? void 0 : (\_person$name$last = \_person$name.last) === null
  || \_person$name$last === void 0 ? void 0 : \_person$name$last.text.length);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you are thinking about what the hell is void 0 then I recommend you to go through this &lt;a href="https://guide.freecodecamp.org/javascript/tutorials/what-does-javascript-void-0-mean/"&gt;article&lt;/a&gt;. It basically evaluates to undefined . Now, look at the above code again to understand it.&lt;/p&gt;

&lt;p&gt;At any point, if the nested property is either null or undefined the expression evaluates to undefined&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Optional Chaining in Typescript&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I’m glad everyone is moving forward with optional chaining much quicker than expected. Typescript 3.7 now has support for Optional Chaining. 🙌&lt;/p&gt;

&lt;p&gt;You can find the release notes &lt;a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's see how the TypeScript code of Optional chaining transpiles to JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(person?.name?.last?.text.length);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I was using the tsc command-line tool to compile the above TS Code and the transpiled code was&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var \_a, \_b, \_c;
console.log((\_c = (\_b = (\_a = person) === null 
  || \_a === void 0 ? void 0 : \_a.name) === null 
  || \_b === void 0 ? void 0 : \_b.last) === null 
  || \_c === void 0 ? void 0 : \_c.text.length);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It is almost the same as what we saw in the babel transpiled code. The object person is being checked at every level in its nested structure to see if the next key in that expression exists, else it returns undefined rather than throwing out an error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Optional Chaining in VS Code
&lt;/h3&gt;

&lt;p&gt;If you were using an older version of VS Code as your editor while running a few of the above code samples then your IDE would have yelled at you with errors.&lt;/p&gt;

&lt;p&gt;Good news, VS Code 1.41 version now supports Optional Chaining. Thanks to Typescript 3.7(that’s what they said). 💪 You can find more info about the release &lt;a href="https://code.visualstudio.com/updates/v1_41#_optional-chaining-support-for-javascript-and-typescript"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is clear that we already have enough support to start using Optional Chaining in our projects. So, update your IDEs, update your TS Version and configure additional plugins to use it now. Let's throw a little fewer runtime errors with our expressions.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>esnext</category>
      <category>optionalchaining</category>
    </item>
  </channel>
</rss>
