<?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: Eric Zumwalt</title>
    <description>The latest articles on DEV Community by Eric Zumwalt (@zumdewald).</description>
    <link>https://dev.to/zumdewald</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%2F110667%2F2c0bfc49-a020-4687-a200-d1858e6cc1d2.jpg</url>
      <title>DEV Community: Eric Zumwalt</title>
      <link>https://dev.to/zumdewald</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zumdewald"/>
    <language>en</language>
    <item>
      <title>My JavaScriptmas Journey</title>
      <dc:creator>Eric Zumwalt</dc:creator>
      <pubDate>Sun, 20 Dec 2020 22:51:41 +0000</pubDate>
      <link>https://dev.to/zumdewald/my-javascriptmas-journey-1hcg</link>
      <guid>https://dev.to/zumdewald/my-javascriptmas-journey-1hcg</guid>
      <description>&lt;h2&gt;
  
  
  Coding through the Advent season
&lt;/h2&gt;

&lt;p&gt;I had the fortune of working through the Scrimba &lt;a href="https://scrimba.com/learn/adventcalendar" rel="noopener noreferrer"&gt;JavaScriptmas challenge&lt;/a&gt; this year and thought I could dedicate my first Dev.to post to my solutions as well as what I learned along the way!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The challenge is drawing to a close, and I'm already anticipating what cool things will be in &lt;strong&gt;next&lt;/strong&gt; years challenge&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Pretty simple layout here: each day is listed out below along with the link to my solution and any notes I had from the challenge. Leave a comment if you learned something or have insight on how I could improve my solutions!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;tldr; If you're just perusing my favs are Days 1, 6, 7, 8, 15.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AND&lt;/strong&gt; I am wondering if you have better solutions for Days 9, 11, 21. Comment if you do!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Day 1 - Candies
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/codcf4b14bf8b41a152c2eafb" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;For absolutely no reason at all I chose to use recursion for this solution. &lt;em&gt;Technically&lt;/em&gt; I altered the original function so I could pass in the running count, but hey, recursion needs what recursion needs what recursion needs .....&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 2 - Deposit Profit
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co8af4f309fc197f107279143" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Simple &lt;code&gt;for&lt;/code&gt; loop here, with a bit of compounding percentage math.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 3 - Chunky Monkey
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/coba5495d82679a3bf7d20df6" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I became more familiar with how the &lt;code&gt;slice()&lt;/code&gt; method worked on this one. Particularly that the second argument is &lt;strong&gt;not&lt;/strong&gt; the amount of items to remove, but where to stop.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 4 - Century From Year
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/cod614b568ffaf1a6089305ee" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Went for a &lt;em&gt;sweeeet&lt;/em&gt; one-liner here using &lt;code&gt;Math.floor()&lt;/code&gt; and the modulo operator. Learned a bit more on what &lt;code&gt;Math.floor()&lt;/code&gt; returns when the argument passed is a decimal.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 5 - Reverse A String
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co7bd4fdf852a8baf8a472559" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Nothing fancy here, but it was good practice with some common string / array methods and how to move between the two types.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 6 - Sort By Length
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co0c74f7aa7202a4c53d082fc" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Did you know you can pass a function to the &lt;code&gt;Array.prototype.sort()&lt;/code&gt; method?? You can, and it will make you feel like you have super-powers...&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 7 - Count Vowel Consonant
&lt;/h3&gt;

&lt;p&gt;-&lt;a href="https://scrimba.com/scrim/cobf442bd93fc04bcfb367d8f" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fair warning, I got a bit flashy on this one... a &lt;em&gt;RegExp &amp;amp;&amp;amp; reducer&lt;/em&gt; in the same solution?? 🤓 This was a fun one to work through. I've used reducers in React before, but never in the wild!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 8 - Rolling Dice
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/cof9d45fbad8b411cb71688bc" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;em&gt;This&lt;/em&gt;&lt;/em&gt; was a challenge... not just JS but some CSS as well. I used data attributes, multiple &lt;code&gt;Math&lt;/code&gt; methods, and some DOM manipulation. Things like this are great practice for real world scenarios.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 9 - Sum Odd Fibonacci Numbers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co348406f8a8a2e397801b6f4" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;This one took a lot of finagling on the logic to get right. Having to &lt;em&gt;generate&lt;/em&gt; a Fibonacci sequence in the function, determine if the &lt;em&gt;current&lt;/em&gt; step was an odd number, and if so add it to a running total...&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 10 - Adjacent Elements Product
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co3c24b7e91352d28ba14df21" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Somewhat simple logic here, but another great example of making yourself think of a problem the way a computer does. Step by step until the solution is found, then quick --&amp;gt; return!!!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 11 - Avoid Obstacles
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co103412c8016c8b31e1f2df7" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I got to learn about the &lt;code&gt;every()&lt;/code&gt; method on this one (never used it before). It was also fun to figure out how to make sure the loop ran until it checked up to the value of the largest entry and didn't just run for the length of the array.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 12 - Valid Time
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co59747a98f988e02cd80beba" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Used our old friend RegExp on this one again! Not for the official solution, but for the format check I added 😁.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 13 - Extract Each Kth
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/coe684655accf44d27ff45af3" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Uh-Oh! Truth time ... In reviewing these for the blog post I found my solution for this one was correct, but in the wrong way 😅; meaning I got the correct solution but not what the problem was asking. Let me just clean it up real quick ...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Alrighty, all fixed! I had originally been testing the item at the current position in the array to see if &lt;strong&gt;&lt;em&gt;it&lt;/em&gt;&lt;/strong&gt; was a multiple of the &lt;em&gt;index&lt;/em&gt; provided instead of checking the &lt;em&gt;position&lt;/em&gt;. This worked in the original test case as the items needing removed were also multiples of the index provided.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 14 - Maximal Adjacent Difference
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co4b14b58b4840e72c808fef6" rel="noopener noreferrer"&gt;Link to soultion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Math.abs()&lt;/code&gt; was the hero on this one. &lt;em&gt;I had no idea Math went to the gym!&lt;/em&gt; Nice abs Math... very helpful.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 15 - JavaScript Carousel
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co547430bac7760b5f368d2ac" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Another great &lt;em&gt;real-world&lt;/em&gt; challenge! I added some 'flare' on this one by using &lt;code&gt;IntersectionObserver&lt;/code&gt; to work the little dots under the slider, indicating which item in the carousel you are on. &lt;code&gt;IntersectionObserver&lt;/code&gt; is super handy. Always there, always watching ... 😳&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 16 - Insert Dashes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/coee6426cb0ea36c825b62589" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Another chance to &lt;code&gt;split()&lt;/code&gt; things apart and &lt;code&gt;join()&lt;/code&gt; them back together. The challenge here was really that you can't let a dash land after a word boundary ... that's the spaces space.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 17 - Different Symbols Naive
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co4bc48c28b16784d7a63411e" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I started to add fun things like 'null checks' and force the input to fit the type needed on this one. For the actual solution &lt;code&gt;Set()&lt;/code&gt; was the shining star. Gotta make sure each item is one of a kind!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 18 - Array Previous Less
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co02b4f3d8f71a84847dc8fb1" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Ignore the extra tests again, I just added them to look cool 🤓&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;I opted to &lt;code&gt;reverse()&lt;/code&gt;, then check, then &lt;code&gt;shift()&lt;/code&gt; for this one. I was familiar with &lt;code&gt;shift()&lt;/code&gt; before hand, but I have never used it before in my coding, so another opportunity to learn!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 19 - Alphabet Subsequence
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/coa6e4967a580589f254e069d" rel="noopener noreferrer"&gt;Link to soution&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I hope you're enjoying my terrible grammar and wordplay in the catches and var names. If not, I am so sorry. I'll go sit in the corner now...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;This JavaScriptmas challenge has definitely taught me a lot about array and string methods! Example: on this one I learned that &lt;code&gt;sort()&lt;/code&gt; changes the &lt;em&gt;original&lt;/em&gt; array and returns a &lt;em&gt;reference&lt;/em&gt;. That became clear to me as I was working through the solution for this one.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 20 - Domain Type
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/coccc4ce8b9c84f4c0eaeea53" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I love switch statements ... probably too much, so this solution got one. Thanks to the previous challenges I was becoming pretty comfortable with array methods at this point so the solution wasn't too difficult.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 21 - Sum Of 2
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co3be4ed8879860e370d73809" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Thought about this one for a bit, and in my mind there was no way around having to add each number in both arrays to get a solution. The question was do I add them all and then check if the value was there or check as I go? 🤔 I went with option number B.&lt;/li&gt;
&lt;li&gt;My solution included nested for loops, but I am curious if there is a faster way. ? Drop a comment if you have a different approach!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 22 - Extract Matrix Column
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/coff049e887fc3734da63e814" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;This was an example of what makes the JavaScriptmas challenge so great. It's not about solving exceedingly difficult problems, for me it's more about being able to quickly identify how you might solve the problem and then start implementing that line of thought. Get out of your head, stop overthinking, use your smarts to get a base idea and then run with it!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 23 - Social Media Input
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co09f497aae358aaf159da5ac" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Tracking user input and adjusting DOM elements based on it is a very valuable skill, and that's exactly the practice this exercise gives. I threw in a few extra CSS animations for fun, but tried to keep the JS focused on what was needed for the solution.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Day 24 - Test Your Agility
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrimba.com/scrim/co57349339313c7f979e4c04a" rel="noopener noreferrer"&gt;Link to solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Whoa, this one made me stop and think hard. It was a blast learning how to work with async await in order to keep / stop a running timer. Before this I only used async functions to initiate a fetch! Cool use case...&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Well,
&lt;/h4&gt;

&lt;p&gt;That's it for this year's JavaScriptmas! Learned a lot of cool things over the course of completing the challenges. Can't wait to see what Scrimba has for us next year!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>scrimba</category>
      <category>firstpost</category>
      <category>christmas</category>
    </item>
  </channel>
</rss>
