<?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: Manik </title>
    <description>The latest articles on DEV Community by Manik  (@manikbajaj).</description>
    <link>https://dev.to/manikbajaj</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%2F374655%2F2db6b920-a717-4b56-8474-39acae4e0bb2.jpg</url>
      <title>DEV Community: Manik </title>
      <link>https://dev.to/manikbajaj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manikbajaj"/>
    <language>en</language>
    <item>
      <title>One Way Data Tables And Variables</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Fri, 07 Apr 2023 12:19:26 +0000</pubDate>
      <link>https://dev.to/manikbajaj/one-way-data-tables-and-variables-4k5j</link>
      <guid>https://dev.to/manikbajaj/one-way-data-tables-and-variables-4k5j</guid>
      <description>&lt;h2&gt;
  
  
  What Are One-Way Data Tables?
&lt;/h2&gt;

&lt;p&gt;One-way data tables are a statistical tool used to analyse the impact of one variable on another variable. A one-way data table consists of one input cell and one or more result cells. The input cell contains the variable that is being&lt;br&gt;
changed, while the result cells contain the formulas or calculations that use the input cell.&lt;/p&gt;

&lt;p&gt;As an example, consider a company that wants to evaluate the impact of different interest rates on their monthly loan payments. The interest rate is the input cell, while the monthly loan payment is the result cell. The company can create a one way data table to see how changes in the interest rate affect the monthly loan payment.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Interest Rate (%)&lt;/th&gt;
&lt;th&gt;Monthly Loan Payment ($)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;499.55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;506.69&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;513.86&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;521.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;528.34&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Read Complete Article On My Blog
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloudaffle.com/series/statistics-and-probability/one-way-data/"&gt;https://cloudaffle.com/series/statistics-and-probability/one-way-data/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>The Difference Between the Shell and the Terminal</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Sat, 19 Nov 2022 06:58:13 +0000</pubDate>
      <link>https://dev.to/manikbajaj/the-difference-between-the-shell-and-the-terminal-27ah</link>
      <guid>https://dev.to/manikbajaj/the-difference-between-the-shell-and-the-terminal-27ah</guid>
      <description>&lt;p&gt;Whenever we give commands to a computer to perform a specific task using text, we refer to it as using the command line interface. When using a command line interface, we use text commands to make our programs work instead of a Graphical User Interface. Using the command line is a different way of interacting with the computer. In the Linux world, when we refer to the command line interface, we refer to a shell and, in most cases, to a bash shell. But often, we use a program to interact with the shell, called a terminal emulator. The shell and the terminal are different from each other but are often used interchangeably.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding The Shell
&lt;/h2&gt;

&lt;p&gt;In one of our previous articles in this series, we discussed what an operating system is and why &lt;a href="https://blog.cloudaffle.com/why-is-ubuntu-a-distribution-and-windows-an-operating-system" rel="noopener noreferrer"&gt;Linux Operating Systems Are Called Distributions&lt;/a&gt;. We know that the kernel is the most crucial component of the operating system. The kernel recognizes all the physical hardware on a computer and enables each component to speak to one another. At the root, the kernel grabs the instructions passed to it and gets them processed by the hardware. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frm4x952642zv76fmwpjo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frm4x952642zv76fmwpjo.png" alt="The shell interacts directly with the kernel" width="613" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The user does not interface with the kernel directly. There is a program called the shell between the user and the kernel, which is responsible for taking the inputs from the user and passing them on to the kernel. Simply put, the shell is a program that takes commands from the keyboard and gives them to the kernel to perform. It acts as an interface between the user and the kernel. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Bash Shell
&lt;/h3&gt;

&lt;p&gt;Most of the Linux distributions come with a shell called the bash shell. Bash is originally the &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community" rel="noopener noreferrer"&gt;GNU Project&lt;/a&gt; shell and was inspired by and built to mimic the original Unix shell program, sh, written by Steve Bourne. Since it was highly inspired by the sh, which was written by Steve Bourne, the folks at the GNU project decided to name the new shell bash, which is an acronym for Bourne Again Shell. &lt;/p&gt;

&lt;p&gt;Many alternatives to the bash shell can be used with the Linux kernel, such as ZSH (ZShell), Fish, KSH (Korn Shell), etc. Different shell programs offer different features, but the basic commands and how to interact with the shell remain the same. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Terminal (Emulator)
&lt;/h2&gt;

&lt;p&gt;Different distributions of Linux come with a Desktop Envornioment installed with it, such as Ubuntu. Ubuntu's Desktop Environment is a modified version of GNOME which stands for GNU Network Object Model Environment. GNOME is a graphical user interface (GUI) and set of computer desktop applications for users of the Linux operating system. When using a Graphical User Interface (GUI) such as GNOME, you need software that can interact with the shell and pass commands that the kernel can execute. This program is called an emulator because it emulates the shell environment for you on your desktop interface. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgk7fbsucml6amg9dxax.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgk7fbsucml6amg9dxax.png" alt="the terminal emulator in Ubuntu Desktop Environment" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Terminal software is a perfect example of an emulator. Terminal ships by default with the Ubuntu Desktop environment and can be used to access the shell. Many emulators are available, and the terminal is just one of them. What is essential to understand is that the emulator is not the shell. It's just a piece of software that enables you to emulate and communicate with the shell in your desktop environment. &lt;/p&gt;

&lt;h2&gt;
  
  
  What Can You Do Next 🙏😊
&lt;/h2&gt;

&lt;p&gt;If you liked the article, consider subscribing to &lt;a href="//youtube.com/c/cloudaffle"&gt;Cloudaffle, my YouTube Channel&lt;/a&gt;, where I keep posting in-depth tutorials and all edutainment stuff for software developers. You can also follow me on Hashnode; my profile handle - @&lt;a href="https://hashnode.com/@cloudaffle" rel="noopener noreferrer"&gt;Cloudaffle&lt;/a&gt;. Leave a like if you liked the article; it keeps my motivation high 👍.&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Why is Ubuntu a Distribution and Windows an Operating System?</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Fri, 11 Nov 2022 11:25:41 +0000</pubDate>
      <link>https://dev.to/manikbajaj/why-is-ubuntu-a-distribution-and-windows-an-operating-system-3f5</link>
      <guid>https://dev.to/manikbajaj/why-is-ubuntu-a-distribution-and-windows-an-operating-system-3f5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;What is a Linux distribution? Why Linux has so many distributions? Why is Ubuntu called a Linux distribution and not an operating system?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linux has a lot of distributions to cater to different types of users. We have Ubuntu which has a full-blown graphical user interface making it perfect for desktop users and beginners to Linux, especially the ones coming from Windows and macOS. Then we have distributions like Red Hat Enterprise Linux, abbreviated as RHEL. Red Hat is a Linux distro designed for Enterprise or commercial purposes. Red Hat is usually a top choice for server environments, given its stability and regular security patches, which boost its overall security. We also have a distribution called Kali Linux. Kali Linux is a Debian-based Linux distro designed for penetration testing and conducting digital forensics. It ships with out-of-the-box tools meant for penetration testing. Kali Linux is meant for Cybersecurity experts and students who want to venture into penetration testing.&lt;/p&gt;

&lt;p&gt;Unlike other commercial operating systems, you would notice that Linux has different flavors that often cater to specific audiences. On the other hand operating systems like macOS and Windows usually come in one solution fits all package. Windows has a different server solution, but at the end of the day, it's Windows that has been modified and contains some special programs to run on a server. The offerings are not varied and user-specific, like Linux distributions, and are all maintained by one company that is Microsoft in the case of Windows and Apple in the case of macOS. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Operating System
&lt;/h2&gt;

&lt;p&gt;To understand Linux, it's crucial to understand what is an operating system. By definition of it, an operating system (OS) is software that manages a computer's hardware resources. An operating system performs two distinct operations:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. An Operating System acts as an interface between the user and the applications.
&lt;/h4&gt;

&lt;p&gt;Let's understand these operations. The first operation is about allowing the user to interact with the hardware and the application on the system. Using an operating system, a user can use the input hardware, such as the keyboard and mouse, and see the output using a monitor. The user can also pass instructions to various applications, such as a web browser, and get the required output. &lt;/p&gt;

&lt;h4&gt;
  
  
  2. An Operating System provides an interface for applications to access hardware resources like the CPU, RAM, printer, and storage.
&lt;/h4&gt;

&lt;p&gt;Secondly, the operating system provides an interface for the applications to interact with the hardware. It takes instructions from applications that need to be processed by a computer's hardware. Then, it converts these instructions to machine-readable format and sends them to the hardware to be processed and sent back to the applications. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why Linux is a Distribution
&lt;/h2&gt;

&lt;p&gt;If you have noticed, I have been calling different flavors of Linux as distributions, and referred to Windows and macOS as operating systems. Is a distribution like Ubuntu not an operating system? The answer lies in the &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community"&gt;history of Linux&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linux is Just A Kernel
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community#heading-the-missing-kernel"&gt;first version of Linux&lt;/a&gt; was released by Linus Torvalds in the year 1991. Since its inception and first release, Linux has always been a kernel, not a full-blown operating system. Now we already understand what an operating system does, and the most crucial component of the operating system is the kernel. The kernel is responsible for interacting with bare metal or computer hardware. It converts the instructions received by applications and converts the instructions to a binary format which is understood by the hardware. Linus is a kernel and not the complete operating system. Since all the Linux distros use the Linux kernel under the hood and combine it with other operating system components, such as the shell, desktop environments, etc, they are called Linux Distributions and not the operating systems. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f1hIkSLY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/020d7p94xnqqvzjs2ssi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f1hIkSLY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/020d7p94xnqqvzjs2ssi.png" alt="Linux Kernel" width="613" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the Linux distributions use the Linux kernel under the hood. Hence, they are more of a  distribution with the same kernel but different implementations to provide the user with a complete operating system. &lt;/p&gt;

&lt;h2&gt;
  
  
  What Can You Do Next 🙏😊
&lt;/h2&gt;

&lt;p&gt;If you liked the article, consider subscribing to &lt;a href="//youtube.com/c/cloudaffle"&gt;Cloudaffle, my YouTube Channel&lt;/a&gt;, where I keep posting in-depth tutorials and all edutainment stuff for software developers. You can also follow me on Hashnode; my profile handle - @&lt;a href="https://dev.to@cloudaffle"&gt;Cloudaffle&lt;/a&gt;. Leave a like if you liked the article; it keeps my motivation high 👍.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>linux</category>
      <category>opensource</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How Did Linux Become So Popular</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Fri, 04 Nov 2022 14:31:54 +0000</pubDate>
      <link>https://dev.to/manikbajaj/how-did-linux-become-so-popular-39</link>
      <guid>https://dev.to/manikbajaj/how-did-linux-become-so-popular-39</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;How Linux, which started as a hobby 🌈 project, became a beast that no one in the tech industry could ignore. Not even Bill Gates 🚀.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linus Torvalds started developing Linux so that he could use a similar environment for his personal computer that he was used to using at Helsinki University. He tried to find an operating system similar to the university computers but could not find one, so he decided to build his own kernel. The story of the &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community#heading-the-gnu-project" rel="noopener noreferrer"&gt;idea of open-source software&lt;/a&gt; started taking shape in the 1980s is fascinating but what is more intriguing is how this hobby project started by Linus Torvalds became a mammoth that we witness today. Compelled by my curiosity, I decided to do some research and funneled down to four major events that propelled the growth of Linux to transform it into one of the most significant community-driven projects in the history of mankind. &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%2Fd1girx5zc4f8fi65ltq1.jpg" 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%2Fd1girx5zc4f8fi65ltq1.jpg" alt="GNU Project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Linus Torvalds made the &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community#heading-the-missing-kernel" rel="noopener noreferrer"&gt;first version of the Linux kernel&lt;/a&gt; available in 1991. Once it was released, it was picked up by the community and got notable traction from the developers working on the &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community" rel="noopener noreferrer"&gt;GNU Operating system&lt;/a&gt; who already had all the components of building an operating system ready but did not have a kernel. From 1991 to 1993, Linux was still in its beta phase where it was not ready to go out as a complete operating system. During its initial years, Linux was still an operating system used mainly by enthusiasts, but something was about to change. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Apache Web Server
&lt;/h2&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%2F1mpweku7d5edjt41ib6g.jpg" 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%2F1mpweku7d5edjt41ib6g.jpg" alt="Apache"&gt;&lt;/a&gt;&lt;br&gt;
For Linux to grow out of the world of enthusiasts and to be adopted by businesses, it needed a real-world use that would make it a must-have technology. That threshold was crossed in 1995 with the development of the Apache Webserver. Since internet adoption was increasing, this because a significant turning point in the history of Linux. Apache was the first application that gave businesses some tangible benefits from using Linux. Now with Linux when you went out to build a server farm using Linux with Apache, it was much more cost effective than building one using Windows NT and the expensive hardware it came with. This meant you had to train your staff for server administration using Linux. Still, the cost of training was much less than the money data centers saved on purchasing Windows licenses and overpriced hardware. But the good news was that hiring new people and training the staff wasn't very expensive since students and enthusiasts were already familiar with Linux as it was used widely at the universities. &lt;/p&gt;

&lt;p&gt;This fuelled the adoption of Linux because of the internet boom. It made sense for the large corporations, internet service providers, and budding e-commerce companies back then to run their applications using Linux to save costs. Since the community of developers contributing to Apache and Linux was usually the same, the performance you got from running Apache on Linux was far better than running it on other operating systems. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Cathedral and The Bazaar
&lt;/h2&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%2Fljo326njv23fs6wkj74q.jpg" 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%2Fljo326njv23fs6wkj74q.jpg" alt="The Cathedral and The Bazaar"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;"The Cathedral and The Bazaar"&lt;/strong&gt; was a white paper written by &lt;a href="https://en.wikipedia.org/wiki/Eric_S._Raymond" rel="noopener noreferrer"&gt;Eric Steven Raymond&lt;/a&gt;, and it was his anthropological analysis of what made the &lt;strong&gt;free software movement&lt;/strong&gt; work. Being a software developer and a &lt;a href="https://blog.cloudaffle.com/gnu-project-and-linux-the-reasons-for-a-thriving-community#heading-the-story-behind-gnu" rel="noopener noreferrer"&gt;GNU Contributor&lt;/a&gt;, he was amused by how Linux could survive and thrive with so many software developers contributing to it. Eric was amused that all the rules he had learned about the software development process, which included controlling complexity, keeping the project groups small, and having closely managed objectives, were all falling apart. If he evaluated Linux based on his experience in software development, then Linux should have been a disaster, but it wasn't; it was something incredible. He was determined to figure out how this worked, so he wrote his white paper. &lt;strong&gt;The Cathedral and The Bazaar&lt;/strong&gt; highlighted two contrasting software development styles. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Cathedral Model&lt;/strong&gt; - The Cathedral model was the conventional and closed software development model. In the cathedral model, you have tight specifications of objectives within small project groups which are run in a relatively hierarchical and authoritarian manner. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Bazaar&lt;/strong&gt; - He termed what was happening in the Linux world as the Bazaar Model. The word "bazaar" means an open market. This was a very open and peer-to-peer kind of software development model, where you had very short release cycles and constant contribution and feedback from people who were developing and using the software simultaneously.   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This whitepaper was vital because it was the final push for Netscape Communications Corporation to release the source code for Netscape Communicator and start &lt;a href="https://www.mozilla.org/en-US/" rel="noopener noreferrer"&gt;the Mozilla project&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Netscape Communicator and The Mozilla Project
&lt;/h2&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%2F8vbb55x6e1pq53wtx5in.jpg" 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%2F8vbb55x6e1pq53wtx5in.jpg" alt="netscape"&gt;&lt;/a&gt;&lt;br&gt;
The next significant event was the day Netscape Communicator decided to open-source its code and create the Mozilla project. This event was important because Netscape was the first big organization to open-source the source code of its products. Netscape went open-source to fight Microsoft, which was giving away internet explorer for free with its operating system but never releasing the source code for Internet Explorer. Netscape feared that no one would buy Netscape Communicator because Internet Explorer came free with Windows and eventually would have created a monopoly lock over the internet. This would have created a survival crisis for Netscape and driven it out of the server market, where it made most of its profits back then. This decision made by Netscape to go open source gave Linux the credibility and the confidence it needed amongst venture capitalists, who then started taking open-source software seriously. &lt;/p&gt;

&lt;h2&gt;
  
  
  Release Of MySQL
&lt;/h2&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%2Fgie7zdwgjmsg1lcmpn0j.jpg" 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%2Fgie7zdwgjmsg1lcmpn0j.jpg" alt="MySQL"&gt;&lt;/a&gt;&lt;br&gt;
Another parallel event that led to cementing Linux as the go-to operating system for the datacenters was the release of an open-source Relation Database Management System A.K.A (RDBMS) called MySQL. MySQL was the first open-source RDBMS based on Structured Query Language(SQL), which was a direct competition to Oracle and MSSql. Web application developers now had a database that they could use in their applications without worrying about licenses, which also brought down the development costs. This started a chain reaction where other database vendors, such as Oracle and Sybase, started porting their databases to run on Linux. &lt;/p&gt;

&lt;h2&gt;
  
  
  What Can You Do Next 🙏😊
&lt;/h2&gt;

&lt;p&gt;If you liked the article, consider subscribing to &lt;a href="//youtube.com/c/cloudaffle"&gt;Cloudaffle, my YouTube Channel&lt;/a&gt;, where I keep posting in-depth tutorials and all edutainment stuff for software developers. You can also follow me on Hashnode; my profile handle - &lt;a href="https://hashnode.com/@cloudaffle" rel="noopener noreferrer"&gt;@Cloudaffle&lt;/a&gt;. Leave a like if you liked the article; it keeps my motivation high 👍.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>linux</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Assign Types To Nested Objects In TypeScript</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Wed, 02 Nov 2022 10:26:21 +0000</pubDate>
      <link>https://dev.to/manikbajaj/how-to-assign-types-to-nested-objects-in-typescript-5g25</link>
      <guid>https://dev.to/manikbajaj/how-to-assign-types-to-nested-objects-in-typescript-5g25</guid>
      <description>&lt;p&gt;Objects are what you are dealing with working as a JavaScript developer, and needless to say, that holds true for TypeScript as well. TypeScript provides you with multiple ways to define type definitions for object properties. We'll look at a couple of them throughout this post, starting with simple examples and moving on to some advanced type definitions. &lt;/p&gt;

&lt;h2&gt;
  
  
  Using the &lt;code&gt;type&lt;/code&gt; Keyword
&lt;/h2&gt;

&lt;p&gt;Object properties can be assigned type definitions using the &lt;code&gt;type&lt;/code&gt; keyword in TypeScript. This is the easiest and preferred method to assign type definitions when dealing with simple objects. Here is an example of an &lt;code&gt;Airplane&lt;/code&gt; type and an &lt;code&gt;airplane&lt;/code&gt; object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Defining Airplane Type&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Creating airplane Object&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;airplane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Airbus A380&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A2201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&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;h3&gt;
  
  
  Nested Objects
&lt;/h3&gt;

&lt;p&gt;If your object has a nested object, you can nest the type definitions using the type keyword itself. Here is an example of a nested object called &lt;code&gt;caterer&lt;/code&gt; inside the &lt;code&gt;Airplane&lt;/code&gt; type definition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;caterer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;airplane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Airbus A380&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A2201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;caterer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Special Food Ltd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;484, Some Street, New York&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1452125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Abstracting Nested Objects Into Separate Types
&lt;/h3&gt;

&lt;p&gt;If you have large objects defining nested type definitions can become cumbersome. In such a case, you can define a separate &lt;code&gt;Caterer&lt;/code&gt; type for the nested object. This will also abstract away the &lt;code&gt;Caterer&lt;/code&gt; type from the &lt;code&gt;Airplane&lt;/code&gt; type, allowing you to use the &lt;code&gt;Caterer&lt;/code&gt; type in the other parts of your code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;caterer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Caterer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;airplane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Airbus A380&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A2201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;caterer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Special Food Ltd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;484, Some Street, New York&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1452125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using Index Signatures With Nested Objects
&lt;/h3&gt;

&lt;p&gt;Index signatures can be used when you are unsure of how many properties an object will have but you are sure of the type of properties of an object. We can define another type called &lt;code&gt;Seat&lt;/code&gt;, which can be the details of the passenger traveling on each seat of the &lt;code&gt;Airplane&lt;/code&gt; type. We can use index signature to assign string type to all seat properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Caterer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Seat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;caterer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nl"&gt;seats&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Seat&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;airplane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Airbus A380&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A2201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;caterer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Special Food Ltd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;484, Some Street, New York&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1452125&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;seats&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mark Allen&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;B5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Interfaces to Assign Types to Object Properties
&lt;/h2&gt;

&lt;p&gt;If you need to create classes to generate objects, using &lt;code&gt;interfaces&lt;/code&gt; instead of the type keyword would be a better option. Here is an example of an &lt;code&gt;airplane&lt;/code&gt; object created using the &lt;code&gt;Airplane&lt;/code&gt; class, which extends the &lt;code&gt;IAirplane&lt;/code&gt; interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;IAirplane&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;IAirplane&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Airbus A380&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;flightNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A2201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;timeOfArrival&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;timeOfDeparture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;airplane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nested Objects Using Interfaces
&lt;/h3&gt;

&lt;p&gt;Just like we used the &lt;code&gt;type&lt;/code&gt; keyword, &lt;code&gt;interfaces&lt;/code&gt; can also be used to strictly type nested objects with classes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ICaterer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ISeat&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;IAirplane&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flightNumber&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfDeparture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;timeOfArrival&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Caterer&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;ICaterer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;public&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;Special Food Ltd&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;address&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;484, Some Street, New York&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;phone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1452125&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Seat&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;ISeat&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;public&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;John Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A3&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="k"&gt;implements&lt;/span&gt; &lt;span class="nx"&gt;IAirplane&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Airbus A380&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;flightNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A2201&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;timeOfArrival&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;timeOfDeparture&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;caterer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Caterer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nx"&gt;seats&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Seat&lt;/span&gt;&lt;span class="p"&gt;()];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;airplane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Airplane&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Can You Do Next 🙏😊
&lt;/h2&gt;

&lt;p&gt;If you liked the article, consider subscribing to &lt;a href="//youtube.com/c/cloudaffle"&gt;Cloudaffle, my YouTube Channel&lt;/a&gt;, where I keep posting in-depth tutorials and all edutainment stuff for software developers. You can also follow me on Hashnode; my profile handle - @&lt;a href="https://hashnode.com/@cloudaffle"&gt;Cloudaffle&lt;/a&gt;. Leave a like if you liked the article; it keeps my motivation high 👍.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>node</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>GNU Project and Linux- The Reasons For A Thriving Community</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Tue, 01 Nov 2022 13:20:24 +0000</pubDate>
      <link>https://dev.to/manikbajaj/gnu-project-and-linux-the-reasons-for-a-thriving-community-1eci</link>
      <guid>https://dev.to/manikbajaj/gnu-project-and-linux-the-reasons-for-a-thriving-community-1eci</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A tribute to the GNU project, the free software movement, and Richard Matthew Stallman (RMS)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For us developers today, open source is an ingrained instinct. We have a thriving community of developers, with hundreds of thousands of developers contributing to open-source code daily. The community that is a part of our development process never actually existed and might not have existed had it not been for the philosophies of &lt;a href="https://www.google.com/search?q=Richard+Matthew+Stallman+(RMS)&amp;amp;oq=Richard+Matthew+Stallman+(RMS)" rel="noopener noreferrer"&gt;Richard Matthew Stallman (RMS)&lt;/a&gt;. To give you the perspective of what this gentleman preached, think about a situation, where you have to program without using millions of open source troubleshooting threads available to you on the internet, including the ones on Stackoverflow.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Linus Torvalds famously said, "Think of Richard Stallman as the great philosopher and think of me as the engineer."&lt;/p&gt;
&lt;/blockquote&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%2Fgyhs4zjpvfxkhckytv3l.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%2Fgyhs4zjpvfxkhckytv3l.png" alt="Linus Torvalds"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The GNU Project
&lt;/h2&gt;

&lt;p&gt;The moment we talk about open-source, the first thing that comes to mind is Linux and  &lt;a href="https://www.google.com/search?q=linus+torvalds&amp;amp;oq=Linus+Torvalds" rel="noopener noreferrer"&gt;Linus Torvalds&lt;/a&gt;. Though Linus Torvalds created Linux and engineered the kernel on which most of the servers work today, &lt;strong&gt;Richard Stallman promoted the concept of free software and started the moment in 1985&lt;/strong&gt;. Back then, Richard Stallman created the legal, technological and philosophical foundation for the free software movement through the GNU Operating System. Without these contributions, it's unlikely that Linux and Open-Source would have evolved into the current forms that we see today.  &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%2Ff098x2nkz28ycanvh1ww.jpg" 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%2Ff098x2nkz28ycanvh1ww.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Story Behind GNU
&lt;/h3&gt;

&lt;p&gt;Richard Stallman joined the MIT Artificial Intelligence Lab in 1971, a thriving community of &lt;em&gt;hackers&lt;/em&gt; (people who loved programming) back then. In the late 1970s and early 1980s, Richard Stallman did some artificial intelligence research and programming at the MIT Artificial Intelligence Lab. During this time, Richard had some negative experiences with the proprietor software and Unix operating system. Some code he wanted to work on and fix was locked up, and he could not make the required changes. Even though the company which owned the software would have benefitted from the changes Richard proposed, he was denied access to the source code. The situation soured him about the whole idea of proprietary software. Because of experiences like this, he developed a profound hostility toward the concept of intellectual property and software. In retaliation, he founded the &lt;strong&gt;&lt;a href="https://www.fsf.org/" rel="noopener noreferrer"&gt;Free Software Foundation&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Stallman was an operating system developer and thought of developing another operating system that would be available for everyone in the community to use freely and tweak the source code as they wished. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;He thought of creating a community that could use the new operating system without the moral dilemma of not being able to share it with other people within the community. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Richard Stallman quit his job at MIT University in January 1984 and started working on the &lt;em&gt;GNU Operating System&lt;/em&gt;. The work GNU itself is a hack, a recursive acronym, and it stands for &lt;strong&gt;GNU - Gnu's Not Unix&lt;/strong&gt;. This was a hit at the At&amp;amp;t labs, which owned the Unix operating system and was proprietary. &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%2Fc1ju8731uuiwwwtmm7st.jpg" 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%2Fc1ju8731uuiwwwtmm7st.jpg" alt="Gnu's Not Unix"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The name meant that Stallman was designing an &lt;strong&gt;operating system that was like Unix&lt;/strong&gt; but was not Unix because GNU was not proprietary, unlike Unix. &lt;/p&gt;

&lt;h3&gt;
  
  
  What Was The Plan
&lt;/h3&gt;

&lt;p&gt;So what was the plan? How did Stallman intend to build an operating system like Unix himself? Unix consisted of multiple programs bound together into an operating system. Stallman started by writing a replacement for each program and invited the other software developer from within the community to join him. As others saw the progress, many software developers started joining him, and by 1991, as Stallman states, they had rewritten entirely almost all of Unix's components. This included the &lt;strong&gt;C-Compiler, a debugger, a text editor, mailers&lt;/strong&gt;, and many other programs. The crucial thing about the GNU Operating system is that it's free software. Free software means the users have the freedom to run, copy, distribute, study, change and improve the software. Free software is a matter of liberty, not price. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To understand the concept, you should think of "free" as in "free speech," not as in "free beer." - Richard Stallman &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Protection From Thieves - GNU General Public License
&lt;/h3&gt;

&lt;p&gt;Since free software does not mean "free beer," the software does have an owner, and it does have a license as well. Free software is not public domain. As Stallman says, the problem with putting the software in the public domain is that someone else will pick it up, modify it, and then sell it as proprietary software. If free software is eventually converted to proprietary software by someone, it would have defeated the whole idea of the free software movement. To prevent this, Stallman decided to use a technique called "Copyleft," which is a kind of the opposite of "Copyright." For this purpose, Stallman decided to make it mandatory for anyone redistributing the software to include a copy of &lt;a href="https://opensource.org/licenses/GPL-2.0" rel="noopener noreferrer"&gt;GNU General Public License&lt;/a&gt; along with the software. This way, it ensured that whoever received a copy of the software also got the right to use it freely, as initially stated in the license with the original copy. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Missing Kernel
&lt;/h2&gt;

&lt;p&gt;The GNU project started by developing an essential toolkit for creating an operating system. Tools included a text editor, a C-compiler, a debugger, and other necessary apparatus. The intention was to ultimately build a kernel that would sit below all these programs developed by the developers involved in the GNU project and convert it into a complete operating system. The entire toolkit was completed by the 1990s and was being used widely, but the problem was that it was still using the Unix kernel. This is the point where Linus Torvalds jumped into the story. &lt;/p&gt;

&lt;h3&gt;
  
  
  Monolithic VS Microkernel
&lt;/h3&gt;

&lt;p&gt;While the GNU project had the essential toolkit for kernel development ready, Linus Torvalds was the one who developed the kernel before the people involved in the GNU project. Torvalds points out that the initial idea behind building Linux was to use a similar environment for his personal computer that he was used to using at the &lt;strong&gt;Helsinki University&lt;/strong&gt;. He tried to find software similar to the university computers but could not find one, so he decided to write his kernel. Since computers at Helsinki University used &lt;strong&gt;SunOS&lt;/strong&gt;, most of the inspiration for Linux initially came from it. &lt;strong&gt;SunOS&lt;/strong&gt; used to be a Unix-based proprietary operating system owned by &lt;strong&gt;Sun Microsystems&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;Linus Torvalds developed a monolithic kernel, meaning the entire kernel was one extensive program, while the members of the GNU project were trying to build a Micro Kernel. This is why Linus Torvalds developed the kernel faster than his counterparts working on the microkernel. The microkernel consists of many small services that interact asynchronously, making the development difficult and time-consuming. Richard Stallman stated that Linus Torvalds developed the kernel much faster than he could, so eventually, the community decided to use the Linux kernel as a part of the GNU Operating System. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Relationship Between GNU and Linux
&lt;/h2&gt;

&lt;p&gt;Ironically, Linus Torvalds started developing Linux independently while the GNU project needed a kernel. Linus Torvalds believed in the same philosophy laid down by Richard Stallman under the GNU project of free and open software. That's the reason they rely heavily on each other. The GNU operating system would not have been possible without a Linux kernel, and Linus would not have been able to develop Linux without the free and open-source C-Compiler the developers involved in the GNU project created. &lt;/p&gt;

&lt;p&gt;They set a perfect example of how a community can thrive through small contributions made by each member. This concept of open source community is a part of the DNA software development today, and the credit goes to the philosophies and contributions of Richard Stallman. &lt;/p&gt;

&lt;h2&gt;
  
  
  Speaking Of Community 🙏😊
&lt;/h2&gt;

&lt;p&gt;If you liked the article, consider subscribing to &lt;a href="https://www.youtube.com/c/cloudaffle" rel="noopener noreferrer"&gt;Cloudaffle, my YouTube Channel&lt;/a&gt;, where I keep posting in-depth tutorials and all stuff that is edutainment for software developers. You can also follow me on Hashnode; here is my profile handle &lt;a href="https://hashnode.com/@cloudaffle" rel="noopener noreferrer"&gt;@cloudaffle&lt;/a&gt; Leave a like if you liked the article; it keeps my motivation high 👍. &lt;/p&gt;

</description>
      <category>programming</category>
      <category>linux</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to Install MySQL 8 on macOS Using Homebrew</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Mon, 31 Oct 2022 13:52:02 +0000</pubDate>
      <link>https://dev.to/manikbajaj/how-to-install-mysql-8-on-macos-using-homebrew-399d</link>
      <guid>https://dev.to/manikbajaj/how-to-install-mysql-8-on-macos-using-homebrew-399d</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A step-by-step guide 📙 on how to install, configure and run MySQL 8 server on macOS using Homebrew 🍺&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I use Homebrew on macOS to manage all the packages I need for development. Once you understand how Homebrew works and how it helps you manage various packages on macOS, installing any dependency on your Mac becomes easy. We will install Homebrew and learn a few essential commands on how we can use Homebrew. Once through with installing Homebrew, we would then move on to &lt;strong&gt;install MySQL server using Homebrew&lt;/strong&gt; and configure it. &lt;/p&gt;

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

&lt;p&gt;Homebrew is a package manager for macOS and Linux &lt;em&gt;(I know you would instead use apt-get or yum based on which Linux distro you are using)&lt;/em&gt;, but just putting it on record that it works with Linux as well 😊. Why would you use a package manager like Homebrew when all the packages come with their independent &lt;code&gt;.pkg&lt;/code&gt; files, and these files can be used to install each package independently? We use a package manager because of a couple of advantages package managers have to offer over independently installing each page. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The main difference between Homebrew and the installer package is the fact that Homebrew takes care of the build time dependencies. If the package you are trying to install requires ruby and some of its dependencies, Homebrew does not require you to build/install ruby and libraries from scratch. Homebrew makes the process of installing packages easy. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every installed package is cleanly sandboxed into its cellar (directory), so you don't have stray files all over your system, just symlinks from bin, man, etc. In the case of macOS with Apple Silicon, all the packages are installed in &lt;code&gt;/opt/homebrew/cellar&lt;/code&gt; directory. Hence you know where all packages are installed.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Homebrew lets you install all the packages with root access and Homebrew installs without root access as well into &lt;code&gt;/usr/local&lt;/code&gt; &lt;strong&gt;(Intel)&lt;/strong&gt; or &lt;code&gt;/opt/homebrew&lt;/code&gt; &lt;strong&gt;(Apple Silicon)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uninstalling is hardly an issue anymore. Homebrew will manage the uninstall process and trim the run time dependencies if needed. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Homebrew provides you with many tools to manage all the packages installed on your machine, which includes various commands to list the packages installed, uninstall them, upgrade packages, search for packages, and so on. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step One: Installing the Xcode Command Line Tools
&lt;/h2&gt;

&lt;p&gt;Before we install any package or Homebrew itself, we first need to install the Xcode Command Line Tools. To do so &lt;a href="https://support.apple.com/en-in/guide/terminal/apd5265185d-f365-44cb-8b09-71a064a42125/mac" rel="noopener noreferrer"&gt;open the Terminal app&lt;/a&gt; on your Mac and run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcode-select &lt;span class="nt"&gt;--install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step Two: Install Homebrew
&lt;/h2&gt;

&lt;p&gt;If you do not have Homebrew installed on your machine, you can follow along, but if you have Homebrew installed and already working with it, you can move on to the next step. You can check if Homebrew is installed on your machine by running the following command in your Terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Homebrew is installed on your Mac, you should get a response containing the version of the Homebrew installed on your machine, which should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Homebrew &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;3.x.x

// Where 3.x.x is the version of the Homebrew installed on your machine. 
// Anything above 3 is good 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Homebrew is already installed, you can move to the next step. If not, hang on while we install Homebrew. To install Homebrew, run the following command in your Terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command should install Homebrew for you and add it to the Path. If you are curious about Homebrew's steps while installing your machine, you can &lt;a href="https://docs.brew.sh/Installation" rel="noopener noreferrer"&gt;read them here&lt;/a&gt;. Once Homebrew is installed &lt;strong&gt;restart the Terminal app&lt;/strong&gt; and rerun the following command to check if Homebrew was installed successfully on your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Homebrew is installed on your Mac, you should get a response that will contain the homebrew version installed on your machine and should look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Homebrew &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;3.x.x

// Where 3.x.x is the version of the Homebrew installed on your machine. 
// Anything above 3 is good 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step Three: Install MySQL 8
&lt;/h2&gt;

&lt;p&gt;Once Homebrew is installed, we will use it to install MySQL 8 on our machine. We would use the &lt;a href="https://formulae.brew.sh/formula/mysql" rel="noopener noreferrer"&gt;MySQL formula&lt;/a&gt; to install MySQL on our Mac. Still, run the following command in your Terminal to start the MySQL installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step Four: Configure MySQL
&lt;/h2&gt;

&lt;p&gt;The above command will install the latest version of MySQL on your Mac. Once MySQL is installed, we need to run the secure installation to assign a password to the root user and create and connect to databases using the root user. You might decide to create another user and not use the root user. But, for this tutorial and assuming that you are installing MySQL on macOS for development workloads, I will stick to using the root user. To secure your MySQL installation, run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you run this above command, you will be requested to assign a password to the root user, and you will see the following prompt in your terminal window. You can enter your preferred password for the root user. This will be the password you will use to connect to your database and perform all operations with MySQL. &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%2F67qs1gdxwts2xo1i36qb.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%2F67qs1gdxwts2xo1i36qb.png" alt="Assign Mysql Password"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, MySQL asks you if you want to enable the &lt;code&gt;Validate Password Component&lt;/code&gt;. The validate password component helps you ensure that users of MySQL use passwords with minimum strength and characters. This is super helpful for production loads where many users are using MySQL, and you want to force strong passwords for all the users. Feel free to use it for production environments, but I will skip it for this tutorial because I am assuming you are configuring MySQL for development and not production. &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%2F7wztx1n2vyx0rpdijdzk.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%2F7wztx1n2vyx0rpdijdzk.png" alt="Validate Password Component"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So as a response to this question, I will type &lt;code&gt;No&lt;/code&gt; and press return. At this point, MySQL will ask you whether you want to keep the password you just entered for the root user or you want to set a new password. Since we want to keep the password we already assigned to the root user, type in &lt;code&gt;No&lt;/code&gt; in your Terminal and press enter. &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%2Fl6w4g0pqyzjjsuk7tavw.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%2Fl6w4g0pqyzjjsuk7tavw.png" alt="Use Existing MySQL Password"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, MySQL creates anonymous users, and now it will ask you whether you want to remove the anonymous users. We can remove the anonymous users as we don't need them and reply to this prompt with a &lt;code&gt;Yes&lt;/code&gt; and press the return key.&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%2F51p0vi5lj852tuklbvgi.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%2F51p0vi5lj852tuklbvgi.png" alt="Disable Anonymous Users"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you get a prompt asking whether you want to disable the remote login for the root user. We will go ahead and disable the remote access for the root user, reply to this prompt with a &lt;code&gt;Yes&lt;/code&gt;, and press the return key.&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%2Foli933djx3gwu1fozrvw.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%2Foli933djx3gwu1fozrvw.png" alt="Disable Remote Access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the next step, you are asked if you want to remove the test database MySQL created. Reply to this with a &lt;code&gt;Yes&lt;/code&gt; as well, which should remove the test database. &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%2Flbdro6zax7cccws8ht9r.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%2Flbdro6zax7cccws8ht9r.png" alt="Remove Test database"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, you are prompted to reload the privileges table for all the changes to take effect. Reply to this with a &lt;code&gt;Yes&lt;/code&gt; and press the return key. &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%2Ffgx9f14toz574dkfdqmz.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%2Ffgx9f14toz574dkfdqmz.png" alt="Reload MySQL Privileges Table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, we have successfully installed MySQL 8 using Homebrew. Now let's go ahead and create a new database. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step Five: Create a New Database
&lt;/h2&gt;

&lt;p&gt;To create a new database with MySQL, we need to sign in as a root user to MySQL in our Terminal. To sign in as a root user, use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysql &lt;span class="nt"&gt;-u&lt;/span&gt; root &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you use this command, you will be prompted to enter your password. Enter the root password you created during the installation process. Once you enter the password, you should be logged into MySQL, and your terminal prompt should now show &lt;code&gt;mysql&lt;/code&gt; like so:&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%2Ffdylxmnocrv5krbrsf97.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%2Ffdylxmnocrv5krbrsf97.png" alt="Logging Into MySQL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you see the above prompt, you can create a new database using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;CREATE DATABASE db_name&lt;span class="p"&gt;;&lt;/span&gt;
// db_name is the name of your database&lt;span class="p"&gt;;&lt;/span&gt; name it whatever you want to
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should get the following response from MySQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Query OK, 1 row affected &lt;span class="o"&gt;(&lt;/span&gt;0.01 sec&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it; you have a new database that you can use with the &lt;code&gt;root&lt;/code&gt; as the username and password assigned to the root user. &lt;/p&gt;

&lt;h2&gt;
  
  
  Subscribe 🙏😊
&lt;/h2&gt;

&lt;p&gt;If I could help you, consider subscribing to &lt;a href="https://www.youtube.com/c/cloudaffle" rel="noopener noreferrer"&gt;Cloudaffle, my YouTube Channel&lt;/a&gt;, where I keep posting in-depth tutorials, and all stuff is edutainment for software developers. You can also follow me on Hashnode; here is my profile handle @&lt;a href="https://hashnode.com/@cloudaffle" rel="noopener noreferrer"&gt;Cloudaffle&lt;/a&gt; Leave a like if you liked the article; it keeps my motivation high 👍. &lt;/p&gt;

</description>
      <category>mysql</category>
      <category>tutorial</category>
      <category>database</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The New Satisfies Operator Will Satisfy You (Cheesy)</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Mon, 31 Oct 2022 05:14:38 +0000</pubDate>
      <link>https://dev.to/manikbajaj/the-new-satisfies-operator-will-satisfy-you-cheesy-4mic</link>
      <guid>https://dev.to/manikbajaj/the-new-satisfies-operator-will-satisfy-you-cheesy-4mic</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I know the title of the post is cheesy 😛 but let me assure you once you know what the satisfies operator does, you will get the context.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TypeScript beta 4.9 came with the new &lt;code&gt;satisfies&lt;/code&gt; operator. The satisfies operator aims to give the ability to the developers to assign the most specific types of expressions for inference. Let's see it in action. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TL;DR&lt;br&gt;
If you prefer watching a video to reading the article, you can watch the &lt;a href="https://youtu.be/6I1Zk79QHZs"&gt;video on YouTube&lt;/a&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Let's Start With a Simple Object
&lt;/h2&gt;

&lt;p&gt;Let's assume that we have a color object. The color object represents a color value in RGB that is red, green, and blue. The value of red, green, and blue can either be a string, a hex code representing a color like &lt;code&gt;#00ff00&lt;/code&gt;, or an array of three numbers representing an array of RGB values. The three numbers in the array are again red, green, and blue values. The structure of the &lt;code&gt;color&lt;/code&gt; object is a standard way of defining color values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Color Object&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;red&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;255&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="na"&gt;green&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#00ff00&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;225&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We want to have the ability to call array methods on each of the properties of the color object. So if I need to get the value of red at the index of &lt;code&gt;0&lt;/code&gt;, I should be able to get it using the bracket notion.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;redComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;red&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="c1"&gt;// 255&lt;/span&gt;

&lt;span class="c1"&gt;// Here, the constant `redComponent` should be equal to  `255`.  &lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Also, since the value of any of these properties can be a string, we would want the ability to use string methods on property values if it's a string. We can declare another constant, &lt;code&gt;greenValue&lt;/code&gt;, and convert the value of the green color to upper case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greenValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;palette&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// '#00FF00'&lt;/span&gt;

&lt;span class="c1"&gt;//  The constant `greenValue` should be converted to upperCase like so '#00FF00'&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Making Our Object Type Safe
&lt;/h2&gt;

&lt;p&gt;While trying to type the color object strictly, we must keep the above use cases in mind and ensure that the object's properties are not misspelled, which means &lt;code&gt;red&lt;/code&gt;, &lt;code&gt;green&lt;/code&gt;, and &lt;code&gt;blue&lt;/code&gt; should always be spelled correctly. Typescript must throw an error if these properties are not spelled correctly. &lt;/p&gt;

&lt;p&gt;To do this, we can declare a type called properties, which will be a union of red, green, and blue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Properties&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the values of each of these properties, we can declare a type called RGB, which is a tuple. A tuple is an array that takes only has three properties that are red, green, and blue. The values of each tuple property will be of the type number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;RGB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;red&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can now use a &lt;code&gt;Record&lt;/code&gt; type, a built-in utility type in TypeScript that constructs an object with Keys and values for those keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Properties&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RGB&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;red&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;255&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="na"&gt;green&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#00ff00&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;225&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The record type here ensures that all the properties of the color object are of the type &lt;code&gt;Properties&lt;/code&gt; and the values of the properties are a union of type &lt;code&gt;RGB&lt;/code&gt; or &lt;code&gt;string&lt;/code&gt;. So we cannot have a property that is not either red, green, or blue. So if I try to misspell blue, TypeScript will throw an error. Also, all the values assigned to these properties now either have to be a string or of the RGB. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem With This Approach
&lt;/h3&gt;

&lt;p&gt;We have only won half of the battle till now. But there is a problem here. Looking at the &lt;code&gt;greenValue&lt;/code&gt; constant, we will see that TypeScript will throw an error. We get an error because TypeScript is unsure about the value of green as a string or a tuple, and we are trying to use a string method to convert a string to uppercase. If the value is not a string, it will result in an error. To use a string method, we would have to manually validate the property before we can use a string method like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;green&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greenValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&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;h3&gt;
  
  
  Introducing The &lt;code&gt;satisfies&lt;/code&gt; operator
&lt;/h3&gt;

&lt;p&gt;For such situations, the new &lt;code&gt;satisfies&lt;/code&gt; operator is super helpful. The &lt;code&gt;satisfies&lt;/code&gt; operator pre-validates the object's properties for us. We can remove the type definition from the color object and use the satisfies operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Color Object&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;red&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;255&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="na"&gt;green&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#00ff00&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;225&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;255&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;satisfies&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Properties&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RGB&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;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 the satisfies operator will validate the red, green, and blue values for us and check whether each of those properties contains a string or an array of RGB. So now, even if I remove the condition from the &lt;code&gt;greenValue&lt;/code&gt; constant, TypeScript will not throw an error because it now knows that the property green contains a string and not an array. Since we used the &lt;code&gt;satisfies&lt;/code&gt; operator, TypeScript pre-validates the values of the properties of the colors object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greenValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;green&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly, if I will now try to use a string method on the value of blue, Typescript will throw an error because it knows in advance that blue is an array of numbers and a string method cannot be applied to an array of numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blueValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// TypeScript Will throw an error  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;satisfies&lt;/code&gt; operator does the heavy lifting for you and checks all the values so that you do not have to manually check each of the values of an object to be of a particular type before using a specific method on that value. If you want to learn TypeScript, you might be interested in taking my &lt;a href="https://youtu.be/vcNtrYfroDY"&gt;TypeScript Crash Course&lt;/a&gt; on YouTube or subscribing for more such updates and tutorials. &lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Consider Blogging As a Privilege</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Sat, 29 Oct 2022 17:07:42 +0000</pubDate>
      <link>https://dev.to/manikbajaj/consider-blogging-as-a-privilege-4573</link>
      <guid>https://dev.to/manikbajaj/consider-blogging-as-a-privilege-4573</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Do we have the 'right' to 'write' what we want, even if it is technically incorrect?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In my humble opinion, just because the publishing platforms are so easily accessible, we developers should not consider publishing technical writings as an &lt;strong&gt;inferred right&lt;/strong&gt; instead, it should be considered a &lt;strong&gt;privilege&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What motivates me to write this post is my encounter with a garbage post recently pushed to my inbox by Medium. The email said that something was trending about JavaScript that I must read. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Medium Story
&lt;/h2&gt;

&lt;p&gt;The story starts with a fine morning when I sat down at my workstation and started my day by checking my emails. I got an email in my Inbox from Medium saying that this article was trending in JavaScript and suggesting that it was handpicked for me and I must read it &lt;em&gt;(pun intended)&lt;/em&gt;. The article had a very catchy title which made me click on the link and made me super excited about the fact that I would get to learn something new. The next thing I see on my screen is a lot of comments on the article, which re-assured my expectations of learning something cool. &lt;/p&gt;

&lt;p&gt;But here is the thing, as I started going through the article and looking at the code examples, I started getting a bad smell about the code. Then a few more lines of garbage, and I thought, either there was something I didn't know about JavaScript or the author had no idea about what was published. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The only reason a sense of self-doubt came about was that the article had attracted many comments, making me think I might be missing something. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And then, I decided to read the comments. Reading through the comments, I started understanding why the article had attracted so much attention. So many seasoned JavaScript developers were cribbing about the post and its contents. The most exciting part of the article was the comments section because the article made no sense. The article came from a noob who had no practical experience whatsoever. I wasn't happy that so many people were speaking against what was posted but saddened by the fact that the author took no action. For a moment, I also thought that the article was published purposely to get traffic and traction. &lt;/p&gt;

&lt;p&gt;Without being judgemental, I decided to post my opinion in the comments and was blunt about the fact that the article was spreading misinformation. To my surprise, my comment on the article got the &lt;strong&gt;fastest first ten claps on Medium&lt;/strong&gt; I have ever got 🤯. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why The Rant?
&lt;/h2&gt;

&lt;p&gt;So what's the big deal about it? Why this rant? I am ranting because I am empathetic toward someone just starting her career as a software developer. &lt;strong&gt;The empathy comes from my journey as a software developer&lt;/strong&gt;. I have been working as one for the last 14 years. I have learned a ton from contributions made by my fellow developers on early years authoritative blogs like &lt;a href="https://www.smashingmagazine.com"&gt;Smashing Magazine&lt;/a&gt;, &lt;a href="https://css-tricks.com/"&gt;CSS Tricks&lt;/a&gt;, etc. They still have a quality control policy in place. &lt;em&gt;(Just to make it clear, this article is not sponsored by them)&lt;/em&gt;. Publications are a source of learning, and as someone starting my career as a software developer, I had full confidence in what these blogs posted. &lt;/p&gt;

&lt;p&gt;Now think about someone new to JavaScript who gets an email from Medium about a new trending topic and lands on this garbage article. Instead of learning anything new, he's misinformed about how he should be writing &lt;em&gt;"clean"&lt;/em&gt; code. The claps and the comments on the article &lt;em&gt;(if not read)&lt;/em&gt; make it seem to be an authoritative post. The problem is not just specific to Medium as a platform. I have seen some YouTubers teaching nonsense with complete confidence and people thanking them in the comments without validating the facts stated in the video and accepting things. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Fight for the Keywords
&lt;/h2&gt;

&lt;p&gt;Suppose you consider the above case a classic example of getting social attraction by the author and nothing else. In that circumstance, you are with me in considering the other side of the coin where people write for keywords and not to solve a problem. Now and then, I hear people talking about content generation as a promising way to attract traffic, which it is, but the content needs to have the correct context. But most of the time, it is written to rank for specific keywords, which only creates more articles that add no value. &lt;/p&gt;

&lt;p&gt;Don't get me wrong; I am not against researching keywords to identify what people are searching for and then generating content to answer their queries. The problem is when you write for the heck of getting traffic and want to rank for the keywords. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I can't stress more that whenever someone clicks a publish button, it should be from the point of view of adding value to the reader's life. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What Can we do as Software Developers?
&lt;/h2&gt;

&lt;p&gt;One thing I love about being a software developer is that I am probably a part of the most thriving and contributing communities the world has ever seen. Platforms like &lt;a href="https://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt; are examples of how people help each other grow in our community. I know things aren't perfect, but our community thrives because of the good people who are a part of it. With the intent to help others, I think there are a few things we can do before we click the publish button. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test the Content&lt;/strong&gt; - Like any piece of good software, the published content needs testing as well. Before you hit the publish button, check and re-check whether the information you are about to share is correct. If the information that you are about to share in your article is not correct, it will do more harm than good to people who will read it. Testing involves keeping the ego aside and being humble about our skillset. I understand that the ability to write code makes us developers special compared to the rest of the population 😉. But being humble about it and understanding that you are not the only developer in this world and confirming your statements before you publish is the way to go. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don't Write for Adrenaline Rush&lt;/strong&gt; - Another change we can bring is to not write for the &lt;a href="https://www.google.com/search?q=adrenaline+rush&amp;amp;oq=Adrenaline+Rush"&gt;Adrenaline Rush&lt;/a&gt;. The content we post should not be driven by selfish motives but should have the intention of educating someone about something we have been able to grasp. This way, we can contribute to each other's knowledge, and everyone can grow in the community. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Share Your Thoughts
&lt;/h2&gt;

&lt;p&gt;What do you think? Has a similar incident happened to you as well? I would love to hear your thoughts and ideas on how we, as a community, can improve the quality of our content contributions. &lt;/p&gt;

&lt;p&gt;P.S: If you like what I write and share a common point of view, follow me &lt;a href="https://hashnode.com/@cloudaffle"&gt;@Cloudaffle on Hashnode&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>programming</category>
      <category>community</category>
      <category>writing</category>
    </item>
    <item>
      <title>In-depth Look Into The JavaScript Script Tag Attributes</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Thu, 08 Apr 2021 14:34:58 +0000</pubDate>
      <link>https://dev.to/manikbajaj/in-depth-look-into-the-javascript-script-tag-attributes-1ei3</link>
      <guid>https://dev.to/manikbajaj/in-depth-look-into-the-javascript-script-tag-attributes-1ei3</guid>
      <description>&lt;p&gt;The script tag is the primary method to insert JavaScript into the HTML page. The script tag has six attributes that are often underutilized and misunderstood by most JavaScript developers. We will look at all the ways to use the script tag and the importance and use of each of the attributes. If you are an experienced JavaScript developer and just interested in knowing about the script tag's attributes, please feel free to jump to the relevant section.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DlnQ8aWL1bI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the Script Tag in HTML
&lt;/h2&gt;

&lt;p&gt;The script tag is the primary method to insert JavaScript into HTML. The script tag was created by Netscape and was first implemented in Netscape Navigator 2, as far as the &lt;a href="https://cloudaffle.com/post/insert-javascript-in-html"&gt;history of JavaScript&lt;/a&gt; is concerned. There are two ways you can use the script tag to insert JavaScript in HTML.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inline JavaScript
&lt;/h3&gt;

&lt;p&gt;You can insert JavaScript directly into an HTML file. Here is an example of how you would do that using the script tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;helloWorld&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;helloWord&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I will go ahead and start with the script tag. Between the script tag, I will create a helloWorld function that prints the text “Hello World” to the console. On the next line, I will go ahead and invoke the function. This is the simplest way to include JavaScript in your HTML page but not the optimal way of doing it. This approach is good for short scripts or scripts which are page-specific. One more thing you need to remember about inline JavaScript is that it cannot be loaded asynchronously or deferred. Inline JavaScript is hence render-blocking; this means that the browser will parse and execute inline JavaScript from top to bottom before moving to the next line of code. Hence, it’s always better to include the inline JavaScripts (if any) in the page's footer once your HTML and CSS have loaded.&lt;/p&gt;

&lt;h3&gt;
  
  
  External JavaScript File
&lt;/h3&gt;

&lt;p&gt;Another way to insert JavaScript into your HTML files is by using an external file. This is the most commonly used method to insert JavaScript files into HTML. Let’s have a look at an example. Assuming this is how files are organized in my project, where I have the index.html file and the main.js file, all in the same project folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./
├── main.js
├── index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how we can insert the main.js file into the index.html file. First, I will declare the script tag, and then in the script tag, we will include an attribute called src . The src attribute points to the JavaScript file that we want to include. It’s as simple as that; the main.js file is now included in our HTML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Script Tag Attributes
&lt;/h2&gt;

&lt;p&gt;There is often much confusion between the attributes of the script tag. The confusion is especially centered around two attributes, defer and async. But let’s look at all the script tag attributes one by one and understand how they impact how the browser treats the external JavaScript file.&lt;/p&gt;

&lt;h3&gt;
  
  
  type (optional)
&lt;/h3&gt;

&lt;p&gt;The type attribute indicates the content type, also known as the MIME type, of the scripting language used in the external file you include in your HTML. This is how you would include a type attribute in your script tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;type = &lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;type = &lt;/span&gt;&lt;span class="s"&gt;"application/javascript"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;type = &lt;/span&gt;&lt;span class="s"&gt;"application/ecmascript"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditionally, the default type has always been &lt;code&gt;"text/javascript"&lt;/code&gt; although this has been deprecated now but is still used by many developers. the current default is &lt;code&gt;"application/javascript"&lt;/code&gt; or &lt;code&gt;"application/ecmascript"&lt;/code&gt; . The safest option is to use these default options; else, using a different MIME type that is not supported by the browser ends up in the script being completely ignored by the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  crossorigin (optional)
&lt;/h3&gt;

&lt;p&gt;Web pages often make requests to load resources on other servers. Here is where Cross-Origin Resource Sharing, often abbreviated as CORS, comes in. A cross-origin request is requested for a resource (e.g., style sheets, iframes, images, fonts, or scripts) from another domain. CORS is used to manage cross-origin requests. It defines a way of how a browser and server can interact to determine whether it is safe to allow the cross-origin request. CORS allows servers to specify who can access the assets on the server, among many other things. Here is an example of how you can use the crossorigin attribute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;crossorigin = &lt;/span&gt;&lt;span class="s"&gt;"anonymous"&lt;/span&gt; &lt;span class="na"&gt;integrity=&lt;/span&gt;&lt;span class="s"&gt;"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;crossorigin = &lt;/span&gt;&lt;span class="s"&gt;"use-credentials"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So there are two possible options for the crossorigin attribute. The first one being the &lt;code&gt;"anonymous"&lt;/code&gt; option. In this case, a cross-origin request is performed, and no credentials are sent. This is often used with the integrity attribute, which sends a hash, and the receiving server verifies the request. We will look into this in detail as the next attribute.&lt;/p&gt;

&lt;p&gt;The next possible value for the crossorigin attribute is &lt;code&gt;"use-credentials"&lt;/code&gt;. In this case, a cross-origin request is performed, and credentials can be sent along with the request. The credentials can be a cookie, a certificate, an HTTP Basic authentication, etc. Most of the time, you would be using the &lt;code&gt;"anonymous"&lt;/code&gt; option, but it’s always good to know that an option to send the credentials exists as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  integrity (optional)
&lt;/h3&gt;

&lt;p&gt;The integrity attribute allows a browser to check the fetched script to ensure that the code is never loaded if the source has been manipulated. I’ll pull an example of the Bootstrap CDN code we often use to insert into our HTML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Latest compiled and minified JavaScript --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script
&lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&lt;/span&gt; 
&lt;span class="na"&gt;integrity=&lt;/span&gt;&lt;span class="s"&gt;"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"&lt;/span&gt; 
&lt;span class="na"&gt;crossorigin=&lt;/span&gt;&lt;span class="s"&gt;"anonymous"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you look at this code closely, it uses a crossorigin of "anonymous" and then there is this integrity attribute, which has something known as the SRI hash, where SRI stands for &lt;a href="https://www.srihash.org/"&gt;Subresource Integrity&lt;/a&gt;. Subresource Integrity (SRI) is a W3C specification that allows web developers to ensure that resources hosted on third-party servers have not been altered. So this means that the Bootstrap JavaScript being served on your page is as it was uploaded by the Bootstrap team and has not been altered. Use of SRI is highly recommended whenever you are using CORS.&lt;/p&gt;

&lt;h3&gt;
  
  
  async (optional)
&lt;/h3&gt;

&lt;p&gt;To use the async attribute, all you need to do is include the attribute in the script tag. Please note that the async attribute works only for external JavaScript files and not for inline JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;async&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The async attribute indicates the browser that the script should start downloading immediately and should not block the rest of the page's rendering. The JavaScript, however, is executed asynchronously with the rest of the page. The async method does not wait for the rest of the DOM to complete loading before it is executed. This is a non-render blocking way of loading your JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  defer (optional)
&lt;/h3&gt;

&lt;p&gt;Using the defer attribute is as simple as using the async attribute. All you need to do is include the defer attribute in your script tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src = &lt;/span&gt;&lt;span class="s"&gt;"main.js"&lt;/span&gt; &lt;span class="na"&gt;defer&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When using the defer attribute, the script execution is deferred until after all the document contents have been loaded completely. However, the script starts downloading immediately but is not executed until all the contents have been loaded and are ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Happens If You Neither Include async Nor defer
&lt;/h2&gt;

&lt;p&gt;In case you neither include the async or the defer attribute in your script, your script becomes render-blocking. This means the browser will first parse and execute the script before it moves to the next lines of code in your HTML. This impacts the loading speed of your web page.&lt;/p&gt;




&lt;p&gt;Get Access To More Such Stories on &lt;a href="https://cloudaffle.com/"&gt;Cloudaffle&lt;/a&gt;&lt;br&gt;
Thanks for reading, and hopefully, this was helpful!&lt;br&gt;
I have created an extensive &lt;a href="https://cloudaffle.com/javascript-cheat-sheet-download"&gt;JavaScript cheatsheet&lt;/a&gt;. It has been in a manner where it becomes easy for you to refer to each property and method for various JavaScript objects. It’s absolutely free to download from the above link ☺.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>react</category>
      <category>angular</category>
    </item>
    <item>
      <title>Mutability Vs Immutability In JavaScript</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Sun, 21 Mar 2021 12:19:54 +0000</pubDate>
      <link>https://dev.to/manikbajaj/mutability-vs-immutability-in-javascript-1k53</link>
      <guid>https://dev.to/manikbajaj/mutability-vs-immutability-in-javascript-1k53</guid>
      <description>&lt;p&gt;You would often hear the most seasoned react developers suggest using the spread operator to copy an array instead of simply assigning it to a new variable. This has to do with specific data types being a reference type in JavaScript, hence being mutable. The concept of mutability and immutability in JavaScript is essential to understand to avoid errors. Let’s dive deeper into the idea of mutability vs. immutability in JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Primitive Types vs. Reference Types in JavaScript
&lt;/h2&gt;

&lt;p&gt;The data assigned to a JavaScript variable can be of two types, the primitive type and the reference type. There is a difference in how JavaScript treats these two data types. To know how they are treated differently, let’s first understand the difference between primitive and reference types.&lt;/p&gt;

&lt;h2&gt;
  
  
  Primitive Types
&lt;/h2&gt;

&lt;p&gt;Primitive types are simple atomic pieces of data in JavaScript. Primitive types are always saved and accessed by the variable's value and not as a reference to another object. There are six primitive types in JavaScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;undefined&lt;/li&gt;
&lt;li&gt;null&lt;/li&gt;
&lt;li&gt;boolean&lt;/li&gt;
&lt;li&gt;number&lt;/li&gt;
&lt;li&gt;string&lt;/li&gt;
&lt;li&gt;symbol&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reference Types
&lt;/h2&gt;

&lt;p&gt;Reference types are not simple atomic values but are objects that are made up of multiple properties assigned to them. They are stored as a reference in memory and not as independent values assigned to variables. There are three reference types in JavaScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;objects&lt;/li&gt;
&lt;li&gt;arrays&lt;/li&gt;
&lt;li&gt;functions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Primitive Types and Reference Types are Stored in Memory
&lt;/h2&gt;

&lt;p&gt;How primitive types and reference types are stored in the memory is the basis of how they are different from each other. Let’s look at a few examples and try to understand how they utilize memory differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Utilization by Primitive Types
&lt;/h2&gt;

&lt;p&gt;As highlighted earlier, primitive types are stored as a single atomic value assigned to a variable in the memory. Let’s see this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;john&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name2&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;/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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxi8uqlrqgvkmsawm10v.jpg" 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%2Fjxi8uqlrqgvkmsawm10v.jpg" alt="Memory Utilization by Primitive Types"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking at the above example, I created a variable name and assigned it a value &lt;code&gt;john&lt;/code&gt;. Now JavaScript will save this as a single atomic value in the memory. Now, if i create a new variable &lt;code&gt;name2&lt;/code&gt; and assign it a value of the variable &lt;code&gt;name&lt;/code&gt; JavaScript will go ahead and create a new space in the memory and allocate the same value of the variable name and assign it to the variable &lt;code&gt;name2&lt;/code&gt;. The new value assigned to the variable &lt;code&gt;name2&lt;/code&gt;, is entirely separate from the variable &lt;code&gt;name&lt;/code&gt; and does not have any reference to it whatsoever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory Utilization by Reference Types
&lt;/h2&gt;

&lt;p&gt;Reference values are objects stored in memory and references to objects instead of dedicated places in memory, unlike primitive types. Let’s look at the following example to understand better how the reference types are saved in memory by JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;john&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s just declared a variable called &lt;code&gt;person&lt;/code&gt; which will contain an object containing the &lt;code&gt;name&lt;/code&gt; and the &lt;code&gt;age&lt;/code&gt; of the &lt;code&gt;person&lt;/code&gt; object. Now I will go ahead and create another variable named &lt;code&gt;person2&lt;/code&gt; and assign it the same &lt;code&gt;person&lt;/code&gt; object. This is where things start getting different as compared to the primitive types. In this case, JavaScript will save the &lt;code&gt;person2&lt;/code&gt; object simply as a reference to the &lt;code&gt;person&lt;/code&gt; object.&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%2Fi28ksb4nurjljycfdawi.jpg" 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%2Fi28ksb4nurjljycfdawi.jpg" alt="Memory Utilization by Reference Types"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you look at this image, you will realize that JavaScript here is actually pointing to the same object in the memory. Though it has created a new variable, as a value, that variable just is referring to the same person object that we created previously.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Immutability and Mutability of Primitive and Reference Types in JavaScript
&lt;/h2&gt;

&lt;p&gt;Since we are now clear with the primitive and reference types in JavaScript, we can easily understand the concept of mutability and immutability in JavaScript. Mutable can be changed or added to where immutable means something that cannot be changed or added. Primitive values in JavaScript cannot have anything added upon to them, they can only be re-assigned, and hence all primitive values in JavaScript are immutable. Let see this with an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;john&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name2&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
 * john
 * john 
 */&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
 * john
 * doe 
 */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Extending our previous example of primitive types, let’s print the values of both our variables, i.e. name and &lt;code&gt;name2&lt;/code&gt; to the console and see what we get. As expected, both the variable return the value &lt;code&gt;john&lt;/code&gt;. Now let’s reassign &lt;code&gt;name2&lt;/code&gt; to &lt;code&gt;doe&lt;/code&gt; and then again print the values of both the variables to the console. Now you see that the value of only &lt;code&gt;name2&lt;/code&gt; was re-assigned by JavaScript to &lt;code&gt;doe&lt;/code&gt;, but the variable &lt;code&gt;name&lt;/code&gt; did not change. This show’s that JavaScript treats these 2 variables separately, although &lt;code&gt;name2&lt;/code&gt; was originally copied from the variable &lt;code&gt;name&lt;/code&gt;. This proves that the primitive values in JavaScript, in this case, strings, are immutable.&lt;/p&gt;

&lt;p&gt;Let’s try to replicate the same example for reference types as well. Picking up from our previous example, let’s print the values of both &lt;code&gt;person&lt;/code&gt; and &lt;code&gt;person2&lt;/code&gt; objects to the console and see what we get.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;john&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
* {
* name: 'john',
* age: 22,
* }
*
* {
* name: 'john',
* age: 22,
* }
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We see two objects printed on the console with the same properties. Now I will change one of the properties of the &lt;code&gt;person2&lt;/code&gt; object and print them to the console again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
* {
* name: 'doe',
* age: 22,
* }
*
* {
* name: 'doe',
* age: 22,
* }
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You see that JavaScript has changed person as well as &lt;code&gt;person2&lt;/code&gt;. This is because the &lt;code&gt;person2&lt;/code&gt; object was created by referencing the &lt;code&gt;person&lt;/code&gt; object. With reference types, JavaScript creates a reference to the same object, and the object remains mutable. Since the object is mutable, it can be changed, or a new property can be added.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Spread Operator
&lt;/h2&gt;

&lt;p&gt;The spread operator was introduced in ES6 (more information on ES6) and lets you copy your objects safely and create a new instance of the object instead of merely referencing the previous object. Let’s look at the same example and see how we can copy an object and save a new instance of the variable's object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;john&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
* {
* name: 'john',
* age: 22,
* }
*
* {
* name: 'doe',
* age: 22,
* }
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s take the same &lt;code&gt;person&lt;/code&gt; object, and instead of assigning it directly to a variable this time, let’s use the spread operator to copy it. The spread operator can be used by prefixing three dots &lt;code&gt;…&lt;/code&gt; in front of the object that you want to copy and encapsulate it using the literal object syntax. This way, JavaScript creates a new object and stores it in the variable &lt;code&gt;person2&lt;/code&gt;. Let’s try to change one of the properties of &lt;code&gt;person2&lt;/code&gt;. I will change the name to &lt;code&gt;doe&lt;/code&gt;. Now let’s print both the object to the console and see what we get. You see, this time, we only changed the name property of the &lt;code&gt;person2&lt;/code&gt; object and not the &lt;code&gt;person&lt;/code&gt; object. This is because the &lt;code&gt;person2&lt;/code&gt; was created and saved as a new object using the spread operator and not as a reference to the &lt;code&gt;person&lt;/code&gt; object.&lt;/p&gt;

&lt;p&gt;PS: I have created an extensive &lt;a href="https://cloudaffle.com/javascript-cheat-sheet-download" rel="noopener noreferrer"&gt;JavaScript cheatsheet&lt;/a&gt;. It has been in a manner where it becomes easy for you to refer to each property and method for various JavaScript objects.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>angular</category>
      <category>vue</category>
    </item>
    <item>
      <title>Escape Sequence in JavaScript - A Few Unused Ones as Well</title>
      <dc:creator>Manik </dc:creator>
      <pubDate>Tue, 08 Dec 2020 13:06:10 +0000</pubDate>
      <link>https://dev.to/manikbajaj/character-literals-in-javascript-a-few-unused-ones-as-well-21g9</link>
      <guid>https://dev.to/manikbajaj/character-literals-in-javascript-a-few-unused-ones-as-well-21g9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Character literals help you format your strings in JavaScript.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/r_HiEL5yPWI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;We will look at simple escape characters that help you achieve small formatting tasks, such as adding a new line in JavaScript to a complete guide on all the available escape&lt;br&gt;
characters. Apart from the new line character, we will also look at various other escape characters in JavaScript and how they can help you format your strings in various ways. Till the end, I promise that you will know a lot more escape&lt;br&gt;
characters than just the new line symbol in JavaScript.&lt;/p&gt;

&lt;p&gt;Since we would be looking at some string character literals, let's declare two variables holding string values to understand how the character literals are working.&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="cm"&gt;/* Declare variables holding some strings */&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;intro&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is John Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fathersName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My father's name is Mark Doe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Escaping double quotes in JavaScript
&lt;/h2&gt;

&lt;p&gt;Let's assume that I want to quote the name of John Doe into double-quotes for some reason. Before we do that, let me add prettier ignore so that prettier does not auto-format my code. Let's try adding double quotes now. You see, the moment&lt;br&gt;
I add double quotes to John Doe, my IDE starts shouting at me because this is a syntax error. If you look closely, you will understand why so. Now the first double quote starts before &lt;code&gt;My&lt;/code&gt; and ends after &lt;code&gt;is&lt;/code&gt;. The second pair of double&lt;br&gt;
quotes for JavaScript start after Doe and ends there as well. Now John Doe becomes an expression that is not recognized by JavaScript and hence this error. This is where we can use our first character literal. In Javascript, character&lt;br&gt;
literals use an escape character '\', which is a backslash like so followed by the character you want to be treated as a string value by JavaScript, so a double quote in our case. Let's end this with the second double quote here as well.&lt;br&gt;
Let me print the result to the console to see what we get. We have indeed added double quotes the way we wanted to.&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="cm"&gt;/* Declare variables holding some strings */&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;intro&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;John Doe&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;intro&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Output -&amp;gt; My name is "John Doe"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Escaping single quotes in JavaScript
&lt;/h2&gt;

&lt;p&gt;Let's have a look at another one now. In our second string here, I will convert it to single quotes for the sake of our example, and it's a perfectly valid syntax to have strings in single quotes. JavaScript makes no differentiation between&lt;br&gt;
them. The moment I do that, you see, I start getting a syntax error. Let's have a closer look to see what is happening. According to JavaScript, now my first string value starts with &lt;code&gt;My&lt;/code&gt; and ending before &lt;code&gt;s&lt;/code&gt; over here, and then another&lt;br&gt;
one starts after the word &lt;code&gt;Doe&lt;/code&gt; which never ends. Javascript cannot recognize this entire expression here, and hence my IDE throws a syntax error. In the same way, we did it with double-quotes. We can add an escape character before the&lt;br&gt;
single quote we have before &lt;code&gt;S&lt;/code&gt;. This is our second character literal where we can escape single quotes by adding a backslash or an escape character. I will output the value to the console to see if JavaScript understands it correctly now.&lt;br&gt;
Certainly, it does work.&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="c1"&gt;// prettier-ignore&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fathersName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My father&lt;/span&gt;&lt;span class="se"&gt;\'&lt;/span&gt;&lt;span class="s1"&gt;s name is Mark Doe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;fathersName&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Output -&amp;gt; My father's name is Mark Doe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding a new line to strings in JavaScript
&lt;/h2&gt;

&lt;p&gt;Okay, let's have a look at another one here. For this, let me copy our intro variable, create another variable, and name it intro2 and remove these double-quotes. Cool! Now, let us assume that I want to add a backslash at the end of John&lt;br&gt;
Doe's name for some reason. Let's add a backslash and print it to the console to see what we get.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;intro2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My name is John Doe &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;intro2&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We get here the string without a backslash, and JavaScript ignored the one we had added. This is because an escape character on its own is of no value and is ignored by JavaScript. JavaScript doesn't understand our intent of printing a&lt;br&gt;
backslash. So we would need to add another backslash after the first one. Now you see we get the desired result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;intro2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My name is John Doe &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;intro2&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Concatenation and new line character in JavaScript
&lt;/h3&gt;

&lt;p&gt;Let's assume that we wanted to print these two sentences together but in two different lines. I will create another variable so that you have the previous one available for your records. I will try to concatenate them and see what we get.&lt;br&gt;
You see, we did join the two sentences, but we don't get them in two separate lines. For that, we can use a new line character literal. Let's add the escape character followed by &lt;code&gt;\n&lt;/code&gt;. This creates a new line. A syntax of declaring string&lt;br&gt;
in JavaScript known as the  &lt;a href="%5Bhttps://cloudaffle.com/blog/template-literals-in-javascript/%5D(https://cloudaffle.com/blog/template-literals-in-javascript/)"&gt;Template Literals&lt;/a&gt; makes creating multiline strings even easier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;intro3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My name is John Doe &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;intro3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;fathersName&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// \n -  for adding a new line  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Unused character literals in JavaScript
&lt;/h2&gt;

&lt;p&gt;There are a few more character literals which are available in JavaScript. Let me add them here in the comments. It is worth noting that I am not covering these in this tutorial because they are not supported by a few browsers and not&lt;br&gt;
relevant for the web. These were created for electronic typewriters, fax machines, etc. But you can refer to them and see what they do; it's always good to know what all you can do with JavaScript.&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="cm"&gt;/*
 * \b   Backspace
 * \f   Form Feed
 * \n   New Line
 * \r   Carriage Return
 * \t   Horizontal Tabulator
 * \v   Vertical Tabulator
 * */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this article was helpful.&lt;/p&gt;

&lt;p&gt;P.S:&lt;br&gt;
I will be covering all the good and the bad parts of JavaScript in the JavaScript Masterclass series. Please follow Cloudaffle and enable notifications to get alerts to the new videos that I keep posting. If you have any questions or&lt;br&gt;
suggestions, please feel free to&lt;/p&gt;

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