<?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: Kulsum Shaikh</title>
    <description>The latest articles on DEV Community by Kulsum Shaikh (@shaikhk2).</description>
    <link>https://dev.to/shaikhk2</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%2F970398%2F962e448e-f428-4d44-9d64-842431f9f5b2.png</url>
      <title>DEV Community: Kulsum Shaikh</title>
      <link>https://dev.to/shaikhk2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaikhk2"/>
    <language>en</language>
    <item>
      <title>Most Popular Code Editors</title>
      <dc:creator>Kulsum Shaikh</dc:creator>
      <pubDate>Thu, 05 Jan 2023 02:41:22 +0000</pubDate>
      <link>https://dev.to/shaikhk2/most-popular-code-editors-3mgb</link>
      <guid>https://dev.to/shaikhk2/most-popular-code-editors-3mgb</guid>
      <description>&lt;p&gt;There are so many different kinds of code editors out there. Many people use different ones based on what they want to do. Some people prefer VS Code for personal projects while some DevOps prefer using Vim. Well, here is a list of a few code editors that many people prefer according to a &lt;a href="https://survey.stackoverflow.co/2022/#overview"&gt;survey&lt;/a&gt; done by Stack Overflow in 2022.&lt;/p&gt;

&lt;h2&gt;
  
  
  NeoVim
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;NeoVim has won best code editor two years in a row. It is a free editor known as the more powerful Vim. It is very fast in performance and is known to be easy in terms of customization. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has better support for plugins which makes it easier for developers to create and maintain plugins.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has a very large community of users which would mean more access to resources and support from fellow users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It has a steep learning curve, which makes it hard to use, especially for beginners. It has a very different modal editing paradigm compared to others. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has compatibility issues. Since it is a fork of Vim, some of the plugins from Vim do not work on it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It has a built in debugger which helps go through the code by stepping into a certain part of it and make changes as needed. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has a wide variety of extensions that add features and functionality to it &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It works on many different platform such as MacOS and Windows which makes it a great choice for developers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Since it has many extensions, it is possible to install too many extensions which will slow down the editor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is a limited amount of customization available in VS code. It does not have as many customizations as many other editors.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  RAD Studio
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It had many different kinds of debugging tools and profiling application tools which helps optimize the performance of the applications. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is support for many different languages such as C++ and C# which makes it better for developers working with multiple languages. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since it is used by many developers, it is actively maintained with regular updates and bugs are fixed often as well.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is not free and it pretty expensive especially for the users who need to upgrade to the latest version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is resource intensive which would make the editor less responsive especially for the developers with lower-end hardware.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>My Programming Journey</title>
      <dc:creator>Kulsum Shaikh</dc:creator>
      <pubDate>Tue, 13 Dec 2022 03:46:02 +0000</pubDate>
      <link>https://dev.to/shaikhk2/my-journey-into-programming-2gi6</link>
      <guid>https://dev.to/shaikhk2/my-journey-into-programming-2gi6</guid>
      <description>&lt;p&gt;"I don't want to be a Programmer like everyone else in the family!" These are the words that I had repeated countless times as I had grown up. I had always wanted to be different. I had dreamed of being many different things like a cop, a fashion designer, and a nurse. &lt;/p&gt;

&lt;p&gt;When I got into 9th grade, I had a class called "intro to Programming". It was a required class so I had to take it. The first few days, I was so lost and felt like I wanted nothing to do with it. As time went on, I started understanding more things. I felt interest in the way it worked. After class, I would ask my dad questions about different concepts in programming. I had even started doing a Python course online. All of this was great, but I still did not want to pursue anything in tech so I gave up on the course overtime.&lt;/p&gt;

&lt;p&gt;After I graduated, I picked my major as Nursing. As I was going through Nursing, I struggled many times. I felt like giving up and went back to it a couple of times. Even though it was great, it didn't feel right for me. I did not want to leave as I had already done a year and a half. I felt like it would be a "waste of time". Then, my family made a sudden decision of moving to Texas from New Jersey. &lt;/p&gt;

&lt;p&gt;When I first moved here, I took a semester off to get settled in. Then, when I started applying to colleges, I realized that most of them are not willing to accept many of the credits that I had worked so hard to achieve. I did not want to start over so I decided to give up on it altogether. While this was going on, my dad had encouraged me to start doing some lessons online as well. &lt;/p&gt;

&lt;p&gt;I started doing a html course and a python course online. I started enjoying it a lot and was doing it regularly. Then, after a few months, my brother told me to apply to Flatiron School. He had went to it and had loved it a lot. I applied to it, not expecting much and started doing LeetCode problems. After a little while, I got accepted! Now, here I am, doing what I love with people that I love! &lt;/p&gt;

&lt;p&gt;With this story, I just want to remind people that no matter how many setbacks there are, you should keep going! You never know which setback is going to change your life forever!&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>Active Record Associations</title>
      <dc:creator>Kulsum Shaikh</dc:creator>
      <pubDate>Tue, 06 Dec 2022 05:26:55 +0000</pubDate>
      <link>https://dev.to/shaikhk2/active-record-associations-3a9p</link>
      <guid>https://dev.to/shaikhk2/active-record-associations-3a9p</guid>
      <description>&lt;p&gt;Associations are the connections between the two models of Active Record. Without associations, programmers would have to write more code to do the same thing that can be done with less code with associations. We will be discussing the two types of Active Record Associations. They are what structure our code to make things not only simple to write but also simple to read. The two types are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One to Many&lt;/li&gt;
&lt;li&gt;Many to Many&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first one that we will be discussing is the One to Many association. This one is the simpler one of the two. In a one to many relationship, the first item has many relationships to the other item but not the other way around. &lt;br&gt;
An example of this would be the relation between games and reviews. A game can have many reviews but a review cannot have many games. It would belong to a specific game. For the relationship of review to game, we would use &lt;code&gt;belongs_to&lt;/code&gt; and for game to review, we would use &lt;code&gt;has_many&lt;/code&gt;. This relationship is shown in Active Record like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Game&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
   &lt;span class="n"&gt;has_many&lt;/span&gt; &lt;span class="ss"&gt;:reviews&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Review&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
   &lt;span class="n"&gt;belongs_to&lt;/span&gt; &lt;span class="ss"&gt;:game&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(&lt;strong&gt;Note&lt;/strong&gt;: reviews for &lt;code&gt;has_many&lt;/code&gt; is plural and game for &lt;code&gt;belongs_to&lt;/code&gt; is singular because, as described before, a game can have &lt;strong&gt;many&lt;/strong&gt; reviews but a review has &lt;strong&gt;one&lt;/strong&gt; game.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The second and last one we will discuss is the Many to Many association. This one is a little more complicated, as a third model is included as well. In a many to many relationship, both the first item and the second item have many relationships with each other. To help keep track, a third item in introduced, which is a merger between the two. &lt;br&gt;
An example of this would be the relation between games and users. A game &lt;code&gt;has_many&lt;/code&gt; users and a user also &lt;code&gt;has_many&lt;/code&gt; games. To help keep track, we will introduce the third one, which will be reviews, as a merger between the two. &lt;br&gt;
Now we can say that a game &lt;code&gt;has_many&lt;/code&gt; reviews, a user &lt;code&gt;has_many&lt;/code&gt; reviews, but a review &lt;code&gt;belongs_to&lt;/code&gt; a game and a user. For the relationship between a game and review AND user and review, we will use &lt;code&gt;has_many&lt;/code&gt;. For the relationship between review and user AND review and user, we will use &lt;code&gt;belongs_to&lt;/code&gt;. This relationship will be shown like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Game&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
   &lt;span class="n"&gt;has_many&lt;/span&gt; &lt;span class="ss"&gt;:reviews&lt;/span&gt;
   &lt;span class="n"&gt;has_many&lt;/span&gt; &lt;span class="ss"&gt;:users&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;through: :reviews&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
   &lt;span class="n"&gt;has_many&lt;/span&gt; &lt;span class="ss"&gt;:reviews&lt;/span&gt;
   &lt;span class="n"&gt;has_many&lt;/span&gt; &lt;span class="ss"&gt;:games&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;through: :reviews&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Review&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
   &lt;span class="n"&gt;belongs_to&lt;/span&gt; &lt;span class="ss"&gt;:game&lt;/span&gt;
   &lt;span class="n"&gt;belongs_to&lt;/span&gt; &lt;span class="ss"&gt;:user&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(&lt;strong&gt;Note&lt;/strong&gt;: For the second &lt;code&gt;has_many&lt;/code&gt; for Game and User, we have added a &lt;code&gt;through:&lt;/code&gt; because Review is the merger that connects them to each other!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, there are two types of Active Record Associations that are discussed. The first one is the One to Many association and the second one is the Many to Many association. One to Many is when first item &lt;code&gt;has_many&lt;/code&gt; of the second item but the second only has one of the first.To show this, a &lt;code&gt;belongs_to&lt;/code&gt; is used for one and a &lt;code&gt;has_many&lt;/code&gt; for the other. This shows that the Many to Many is when the first item &lt;code&gt;has_many&lt;/code&gt; of the second and vice versa. To keep track, there is a third item introduced which &lt;code&gt;belongs_to&lt;/code&gt; both of the items. To show this relationship, a &lt;code&gt;has_many: , through:&lt;/code&gt; is used to show the relationship between the three!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Conditional Operators</title>
      <dc:creator>Kulsum Shaikh</dc:creator>
      <pubDate>Tue, 22 Nov 2022 04:25:48 +0000</pubDate>
      <link>https://dev.to/shaikhk2/conditional-operators-505p</link>
      <guid>https://dev.to/shaikhk2/conditional-operators-505p</guid>
      <description>&lt;p&gt;Today, we will be discussing two types of conditional operators. The first one is a if else statement and the second is the ternary operator.&lt;/p&gt;

&lt;p&gt;Let's start with the if else statement's syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;statement1&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;statement2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;statement3&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: You don't have to have two different conditions. It can also be done with just an if statement and an else statement (without an &lt;code&gt;else if&lt;/code&gt;).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The condition in the if statement can be any condition that can be truthy or falsy. Then, the statement states what will happen if that condition is met. Then, you can either add another condition or just have a general statement (which will be put into &lt;code&gt;else&lt;/code&gt;) that will happen if the first condition is not met. &lt;/p&gt;

&lt;p&gt;Now, let's try it out!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ifStatements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I'm greater than 15!&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="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I'm between 10 and 15!&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="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I'm everything else!&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="nf"&gt;ifStatements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// This gives "I'm everything else!"&lt;/span&gt;
&lt;span class="nf"&gt;ifStatements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// This gives "I'm greater than 15!"&lt;/span&gt;
&lt;span class="nf"&gt;ifStatements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// This gives "I'm between 10 and 15!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Based on what x had equaled, the &lt;code&gt;console.log&lt;/code&gt; gave us different answers!&lt;/p&gt;

&lt;p&gt;Now, let's look at ternary operators! Personally, I like ternaries more because of two things: It's short and it can be done in one line! &lt;/p&gt;

&lt;p&gt;The syntax for ternary operators looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;condition&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;expressIfTrue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;expressIfFalse&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The condition in a ternary is a condition that will either be truthy or falsy (just like an &lt;code&gt;if&lt;/code&gt; statement). The first expression will be shown if the condition is truthy. If the condition is falsy, the second expression will be shown. &lt;/p&gt;

&lt;p&gt;Let's look at how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ternaryOperators&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isHappy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isHappy&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Yay!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;It's okay to feel upset!&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ternaryOperators&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// "Yay!"&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;ternaryOperators&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// "It's okay to feel upset!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Based on whether &lt;code&gt;isHappy&lt;/code&gt; was true or false, the &lt;code&gt;console.log&lt;/code&gt; gave us the two different strings!&lt;/p&gt;

&lt;p&gt;I think Ternary Operators are better if you want to check one condition while if statements are better if you have multiple conditions that you want to check! Both are very useful and help make JavaScript easier to use!&lt;/p&gt;

</description>
      <category>development</category>
      <category>programming</category>
      <category>devops</category>
      <category>discuss</category>
    </item>
    <item>
      <title>.toLowerCase() or not to Lowercase</title>
      <dc:creator>Kulsum Shaikh</dc:creator>
      <pubDate>Mon, 14 Nov 2022 17:15:30 +0000</pubDate>
      <link>https://dev.to/shaikhk2/tolowercase-or-not-to-lowercase-1bb1</link>
      <guid>https://dev.to/shaikhk2/tolowercase-or-not-to-lowercase-1bb1</guid>
      <description>&lt;p&gt;.toLowerCase() is a method in JavaScript that is used to convert any string to lowercase. The return value for it is also a string. &lt;/p&gt;

&lt;p&gt;There are many reasons as to why someone would need to use it. One example would be if someone has a search bar on their website. Since user input is unpredictable, we need to make sure we are handling the user input in the best way possible. We should convert the strings into one case which is why we were making it all lowercase. Doing that will ensure that the results will match the search. &lt;/p&gt;

&lt;p&gt;Let’s look at how .toLowerCase() works!&lt;/p&gt;

&lt;p&gt;First, lets declare a string with the name of stringOne:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stringOne&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="nx"&gt;Let&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="nx"&gt;see&lt;/span&gt; &lt;span class="nx"&gt;HOW&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;Works&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we will use the syntax for .toLowerCase() on this string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;StringOne&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we can console.log the string with and without the new syntax to see the difference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stringOne&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;stringOne&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's see what the console.log shows us:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let’s see HOW .toLowerCase() Works
let’s see how .tolowercase() works
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we did not have this method, we would have to manually parse the string using regular expressions. That would take a really long time!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
