<?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: KollerCode</title>
    <description>The latest articles on DEV Community by KollerCode (@kollercode).</description>
    <link>https://dev.to/kollercode</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%2F708813%2F845d66ae-2dee-4324-83e6-e11340761527.jpg</url>
      <title>DEV Community: KollerCode</title>
      <link>https://dev.to/kollercode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kollercode"/>
    <language>en</language>
    <item>
      <title>Fun with Array Iteration</title>
      <dc:creator>KollerCode</dc:creator>
      <pubDate>Fri, 21 Jan 2022 15:00:20 +0000</pubDate>
      <link>https://dev.to/kollercode/fun-with-array-iteration-10cg</link>
      <guid>https://dev.to/kollercode/fun-with-array-iteration-10cg</guid>
      <description>&lt;p&gt;I remember first messing with arrays in the beginning of my bootcamp prep-work days and thinking to myself, "I have a feeling I am going to be seeing this a lot." Fast-forward to today upon the completion of my Phase 1 JavaScript project at Flatiron where I realized just how right I was. &lt;/p&gt;

&lt;p&gt;I may be weird, but of all of the things that I have learned in JavaScript up to this point, all things arrays and objects have been the most interesting to me. Learning how to add and remove elements to arrays by using commands such as .push() and .shift() came easily to me. However, once I was introduced to &lt;strong&gt;looping&lt;/strong&gt; and &lt;strong&gt;iteration&lt;/strong&gt; things got a little bit more complicated. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This can get confusing, let's understand the difference:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Looping&lt;/strong&gt; executes a set of statements (typically uses &lt;em&gt;for&lt;/em&gt; or &lt;em&gt;while&lt;/em&gt;) and allows us to loop over the same block of code again and again until a condition is met or the code within the code block has run the amount of times desired. &lt;br&gt;
&lt;strong&gt;Iteration&lt;/strong&gt; executes a set of statements once for each element in a collection.&lt;br&gt;
&lt;em&gt;A loop can be iterated over many times&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My project required that I render some data from an open API. In order to get the objects to manifest on the page in the way I desired I needed to iterate over an array of objects within that API using &lt;strong&gt;forEach()&lt;/strong&gt;. But, the &lt;strong&gt;for&lt;/strong&gt; loop also allows you to iterate over an array as well. I’m going to focus this tutorial on these two specifically. With fun pictures that I’ve created!&lt;/p&gt;

&lt;h2&gt;
  
  
  The For loop
&lt;/h2&gt;

&lt;p&gt;The For loop loops an item in an array in a countdown using a start and stop count. It's made up of 4 parts: initialization, condition, final expression, and statement.&lt;br&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%2Fm1333pv6gvpygdxqvax1.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%2Fm1333pv6gvpygdxqvax1.png" alt="Initialization"&gt;&lt;/a&gt;&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%2Fan9rrhpa4ipalouk2kty.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%2Fan9rrhpa4ipalouk2kty.png" alt="Condition"&gt;&lt;/a&gt;&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%2Foleqh9rm41tstzxzf5p8.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%2Foleqh9rm41tstzxzf5p8.png" alt="Final Expression"&gt;&lt;/a&gt;&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%2Fa51ojn1c39i9hpoc2bww.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%2Fa51ojn1c39i9hpoc2bww.png" alt="Statement"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Using forEach()
&lt;/h2&gt;

&lt;p&gt;In the case of my project, there were only a few elements that I wanted to render on the page from this array of objects in the &lt;a href="http://makeup-api.herokuapp.com/api/v1/products.json?brand=maybelline" rel="noopener noreferrer"&gt;makeup API&lt;/a&gt; using a fetch request. &lt;br&gt;
The easiest way I found was to create our array in global scope. This allows us to create a function and assign it to a variable in order to access the items in the array. Once I set up my GET request, I created a CSS element to store the collection of makeup items I wanted to render on the page and then assign it a variable to be used in my function forEach(). Then I used the parameter "makeup" and the function "rendermakeup" throughout my project. &lt;br&gt;
In plain English: &lt;strong&gt;from my makeupArray (which is the json aka the api) for Each makeup in that array add it to the collection and do what the function (renderMakeup) is asking to do to it&lt;/strong&gt; which in my case is show the price, picture, and name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let makeupArray = [] 
const fetchArray = () =&amp;gt; {
fetch("http://makeup-api.herokuapp.com/api/v1/products.json?brand=maybelline")
        .then((response) =&amp;gt; response.json()).then(function (json) {
            //the json array is what is being
            // returned and is 54 items long
            makeupArray = json;
            let makeupCollection = document.getElementById("makeup-collection");
            makeupArray.forEach((makeup) =&amp;gt; (makeupCollection += renderMakeup(makeup)));
        });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To bring it back to more simplified fun images explaining forEach() and maybe a more common way you might use it you can see the images below:&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%2F71fcj12vdvhg6qpmeomv.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%2F71fcj12vdvhg6qpmeomv.png" alt="Array"&gt;&lt;/a&gt;&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%2Fobnt1j6zg586hvozbzk1.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%2Fobnt1j6zg586hvozbzk1.png" alt="function"&gt;&lt;/a&gt;&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%2Fpee5yta1yd6jwr8rov4c.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%2Fpee5yta1yd6jwr8rov4c.png" alt="forEach"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To wrap things up on our fun with array iteration, just know that whichever method  you choose to use, know that it is a matter of preference. I'm sure every developer has had to use these at some point, although I am curious to know how often. Leave me a comment telling me what you think!&lt;/p&gt;

&lt;p&gt;To those of you who got this far, thank you and I hope that you find this helpful!&lt;/p&gt;

&lt;p&gt;And to anyone wanting to take a look at my final project, you can find it on my github here:&lt;a href="https://github.com/KollerCode/Shopping-Project" rel="noopener noreferrer"&gt;https://github.com/KollerCode/Shopping-Project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Coding!👩🏽‍💻 &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Sad Truth as to Why I Chose to Change Careers to Software Engineering</title>
      <dc:creator>KollerCode</dc:creator>
      <pubDate>Sun, 16 Jan 2022 20:56:32 +0000</pubDate>
      <link>https://dev.to/kollercode/the-sad-truth-as-to-why-i-chose-to-change-careers-to-software-engineering-nm0</link>
      <guid>https://dev.to/kollercode/the-sad-truth-as-to-why-i-chose-to-change-careers-to-software-engineering-nm0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;When I am coding, it's like I am solving problems in my own life and it reminds me that as long as I don't give up and I am persistent I can do anything.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'm going to date myself here, but I remember the first time my grandfather let me play on his computer. Back then, it had no mouse. We had to use the arrow keys and the enter button the navigate the files. Oh, and the internet? That didn't exist yet. But when it did, we needed a phone line and an awful screech to tell us when we were connected. &lt;/p&gt;

&lt;p&gt;I grew up alongside the biggest advances in technology. I know computers practically as well as I know how to drive a car. However, it wasn't until 2021 when life hit me hard that I even considered making a career out of anything computer related. &lt;/p&gt;

&lt;h2&gt;
  
  
  Warning, it's about to get REAL sad and honest here
&lt;/h2&gt;

&lt;p&gt;My year began with news that I was pregnant with my first child. I had not mentioned anything to my director at the time in fear of losing my job since I knew I was not the only pregnant woman on our team. Then, my cat broke his hip-bone and we discovered he has a rare degenerative bone disease that would require surgery. This added more unexpected costs. &lt;/p&gt;

&lt;p&gt;The worst happened when my husband fell ill and we found a large tumor in his lung. He served in Afghanistan and we think that may have caused it- but that's a story for another time! The tumor was cancerous, but once the surgeon removed it, the cancer was taken with it. Shortly after my husband was in and out of the hospital with a collapsed lung. 2 surgeries, one massive infection, 2 lobes removed and several chest tubes and hospitalizations later, a near-death experience, and 7 months later he is finally recovering well and able to lift our son and return to work.&lt;/p&gt;

&lt;p&gt;During that time, the baby's fluid levels were dangerously low and I had to be induced. After the baby was safe, I had to stay in the hospital for a few more days with post-partum Pre-eclampsia. &lt;strong&gt;Once I finally recovered, I had to be the bread-winner, the caretaker for both the baby and my husband, and take care of the house all while trying to recover myself as well.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I spoke with my director to return to work after just 2 weeks of &lt;strong&gt;unpaid&lt;/strong&gt; maternity leave (not really leave, more of a two week vacation) only to find out that another person had been hired in my place and given my laptop (which had been wiped). I gave so much to this institution, worked from the hospital, only to be replaced during my time of need.&lt;/p&gt;

&lt;p&gt;After nearly being evicted, my sister and her boyfriend who work for Microsoft mentioned to me that I should have worked in tech years ago. She felt I deserved better than the pay and the treatment I received. Also, my grandfather was an OG computer programmer. It literally RUNS IN MY BLOOD. &lt;/p&gt;

&lt;p&gt;The only beacon of hope that has kept me going through this arduous time is that I know this change of career feels right. &lt;em&gt;When I am coding, it's like I am solving problems in my own life and it reminds me that as long as I don't give up and I am persistent I can do anything.&lt;/em&gt;&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%2Fuser-images.githubusercontent.com%2F90989922%2F151552645-d5d0ac7d-fd9a-492c-8934-0394ae8ea881.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%2Fuser-images.githubusercontent.com%2F90989922%2F151552645-d5d0ac7d-fd9a-492c-8934-0394ae8ea881.jpg" alt="Us after Miguel's final procedure and hospitalization! (Thanksgiving)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading ya'll! Be on the lookout for some technical blogs coming your way real soon! I've got one cooking right now about some JavaScript  commands. &lt;/p&gt;

&lt;p&gt;Nothing but love,&lt;/p&gt;

&lt;p&gt;-Natasha&lt;/p&gt;

</description>
      <category>career</category>
      <category>motivation</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
