<?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: RedDev</title>
    <description>The latest articles on DEV Community by RedDev (@reddev37323224).</description>
    <link>https://dev.to/reddev37323224</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%2F630864%2Fae9a9b4d-19cc-4bb4-b8dc-ed1adf0b6b03.png</url>
      <title>DEV Community: RedDev</title>
      <link>https://dev.to/reddev37323224</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/reddev37323224"/>
    <language>en</language>
    <item>
      <title>Writing JS functions as a newbie</title>
      <dc:creator>RedDev</dc:creator>
      <pubDate>Fri, 14 May 2021 00:53:18 +0000</pubDate>
      <link>https://dev.to/reddev37323224/writing-functional-js-as-a-newbie-298c</link>
      <guid>https://dev.to/reddev37323224/writing-functional-js-as-a-newbie-298c</guid>
      <description>&lt;p&gt;This past Tuesday I had an abnormal amount of downtime at my current job. I decided to use that time to play with JavaScript on my own. I've seen other background color changing projects and figured I'd take a swing.&lt;/p&gt;

&lt;p&gt;I'm in the middle of a website project for a co-worker. My friend and code mentor helped me with a mobile menu using JS for the project. Using that function as a starting point, I tried changing the background color with an on-click event. With no success, I turned to Google and found a simple way to do what I wanted using &lt;code&gt;document.body.style.background&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then it was time to tackle the text color change on the h1 element. After some more Google, I found &lt;code&gt;document.getElementById().style.color&lt;/code&gt; to work nicely.&lt;/p&gt;

&lt;p&gt;Everything was functional and I excitedly sent my friend the CodePen link, which at the time was the same code as this post's cover image- five nearly identical functions and all. It was gratifying to hear that it looked good, but he then said I could do the same thing with only one function. After all that work!?&lt;/p&gt;

&lt;p&gt;One Zoom call and some explaining later, it made sense! Arguments, "Ah-ha!" I remembered using them in FreeCodeCamp exercises, but it's much different when you're actually building something. Now I have a better idea of how arguments and JavaScript in general works. It was frustrating but the payoff was totally worth the aggravation.&lt;/p&gt;

&lt;p&gt;I don't know if you need to hear this, but do not give up. Just keep trying. This small project has allowed me to connect  dots and put some JavaScript things into perspective. I'm excited for the future and eager to keep going.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/redwagen/pen/PopPBGV"&gt;Here&lt;/a&gt; is the single function background color changer. I hope you have as much fun as I do clicking those buttons. :)&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>javascript</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
