<?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: Rhodé Zwijnenburg</title>
    <description>The latest articles on DEV Community by Rhodé Zwijnenburg (@rhode).</description>
    <link>https://dev.to/rhode</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%2F233283%2F7b479b74-0a18-41a4-a99d-d05197c8344f.png</url>
      <title>DEV Community: Rhodé Zwijnenburg</title>
      <link>https://dev.to/rhode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rhode"/>
    <language>en</language>
    <item>
      <title>Three easy tips to become a successful developer, by getting to know your feelings</title>
      <dc:creator>Rhodé Zwijnenburg</dc:creator>
      <pubDate>Sun, 11 Oct 2020 14:47:03 +0000</pubDate>
      <link>https://dev.to/rhode/three-practical-tips-to-get-to-know-your-own-feelings-and-improve-your-emotional-intelligence-as-a-developer-4o8</link>
      <guid>https://dev.to/rhode/three-practical-tips-to-get-to-know-your-own-feelings-and-improve-your-emotional-intelligence-as-a-developer-4o8</guid>
      <description>&lt;p&gt;To become successful, having well developed emotional intelligence is key, especially as a developer. Emotional intelligence is proven to be very important in becoming more successful, increasing your physical health and psychological health and for becoming a better leader&lt;sup&gt;[1]&lt;/sup&gt;. So that is quite a lot. I’m very curious to see if there are people who after reading the list above think: "Nah, I don’t want to be in good psychological health and I quite like being stressed out all the time". So if you’re an actual human that wants to feel good and succeed in life, keep on reading. The good news is that emotional intelligence, unlike IQ, can be learned ! So what is emotional intelligence (also called EI or EQ) exactly?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Emotional intelligence is&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Being able to identify your own emotions and those of others&lt;/li&gt;
&lt;li&gt;Being able to use emotional information to guide thinking and behavior &lt;/li&gt;
&lt;li&gt;Manage and/or adjust emotions from yourself and others to adapt to environments or achieve goals&lt;sup&gt;[2]&lt;/sup&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For these three topics, there are some easy and practical tips to achieve those things by increasing your emotional intelligence. In this blog I will provide you with tips to get to know your own feelings. Recognizing your own feelings is an important step to develop your Emotional Intelligence and becoming more successful. In upcoming posts, we will look at the other aspects too. But be warned before you read further, it’s about emotions…! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get to know your own feelings&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Observe the emotions you experience during one meeting at work. You’ll be surprised how many emotions you may experience, even during one short meeting. For instance: When playing planning poker you feel a little ashamed when the whole team has given a task 5 points, but you thought it was 20. Or being annoyed and a little angry when someone is talking through your fantastic plea. Or feeling frustrated and bored, because the discussion went on a tangent and is taking sooooo long etc. &lt;/li&gt;
&lt;li&gt;Get to know all the feelings. Most of the time we only use basic emotions which does not always do justice to what you feel in reality. You’re saying a lot more if you are able to say that you feel bad about a plan because you are disappointed in the quality of it, rather than if you would only say you feel bad about it. Feeling bad about something could also mean that you are sceptical, offended, nervous or disinterested about the idea, which has very different implications for the  handling of the original idea. &lt;a href="http://www.psychpage.com/learning/library/assess/feelings.html"&gt;This website&lt;/a&gt; gives an example of a lot more feelings. Try to expand your vocabulary on emotions, so that you are able to express yourself better and to become better in detecting the feelings of others. &lt;/li&gt;
&lt;li&gt; Be honest to yourself: see where you excel, but also where your weaknesses are. Try to feel and accept feelings you are less proud of, like jealousy or insecurity. Most of the time we try very hard not to feel these emotions, because we think they are bad. But the emotions themselves are not inherently wrong, it’s about the actions you might undertake because of those emotions which could be bad. Do you know your own biggest fears? And no, I’m not talking about some mild fear or spiders. Most people fear failure, loss, being judged, losing control, losing identity or fear of who they really are. Find your biggest fears, feel them, however uncomfortable, and accept those feelings. This is important, because suppressed feelings result in undesirable behavior. For example, when you fear failure and retrieve critical feedback from  your reviewer, you’ll question his knowledge. You’ll ignore his feedback, instead of trying to learn from the feedback and adjust the code in a better way.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;br&gt;
It’s possible to develop your emotional intelligence, by getting to know your own emotions. &lt;br&gt;
Three practical tips to achieve this are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Observing your own emotions&lt;/li&gt;
&lt;li&gt;Getting to know all the feelings&lt;/li&gt;
&lt;li&gt;Being honest to yourself. 
Doing this can help you become a more complete and successful human and developer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Tips to get to know feelings of others and learning the impact that you have on others will be given in my next blog posts. &lt;/p&gt;

&lt;p&gt;[1] Black, P. H., &amp;amp; Garbutt, L. D. (2002). Stress, inflammation and cardiovascular disease. The Journal of Psychosomatic Research, 52, 1–23.&lt;br&gt;
[2] Colman, Andrew (2008). A Dictionary of Psychology (3 ed.). Oxford University Press.  Goleman, D. (1995). Emotional intelligence. New York, NY: Bantam Books, Inc. Retrieved from &lt;a href="https://positivepsychology.com/importance-of-emotional-intelligence/"&gt;https://positivepsychology.com/importance-of-emotional-intelligence/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Reduce for beginners</title>
      <dc:creator>Rhodé Zwijnenburg</dc:creator>
      <pubDate>Tue, 05 Nov 2019 13:49:06 +0000</pubDate>
      <link>https://dev.to/rhode/reduce-for-beginners-kl6</link>
      <guid>https://dev.to/rhode/reduce-for-beginners-kl6</guid>
      <description>&lt;h2&gt;
  
  
  What is reduce and why should I use it?
&lt;/h2&gt;

&lt;p&gt;Reduce iterates over each value of an array, and reduces it to a single value, which could be anything. &lt;br&gt;
There are lots of use cases where reduce comes in handy, for example when you need to: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;calculate the sum of your array&lt;/li&gt;
&lt;li&gt;calculate  the average of your array&lt;/li&gt;
&lt;li&gt;calculate  the biggest number of your array&lt;/li&gt;
&lt;li&gt;calculate  the longest word of your array&lt;/li&gt;
&lt;li&gt;count how many times each item is present in the array. &lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The basics
&lt;/h2&gt;

&lt;p&gt;You might be familiar with the reduce syntax from &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Syntax"&gt;MDN&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;arr.reduce(callback(accumulator, currentValue[, index[, array]])[, initialValue])&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A tear came out of your eye and you even might consider switching careers. Don't worry; you are not the only one who didn't understand the syntax immediately. The good news: it's way easier than it looks. With the reduce function you can get the same thing done as with the good old for-loop, only is the reduce function based on functional programming, so you are more forced to use these principles like not mutating data and not introducing side effects. But watch out, you're still able to do this if you use reduce the wrong way. :') Take a look at the for-loop and the reduce function in the snippets below, where we add up each value of the array.  The &lt;code&gt;myArray[i]&lt;/code&gt; variable in the for loop is comparable with the &lt;code&gt;arrayVal&lt;/code&gt; of the reduce function. The count variable in the for-loop example underneath is comparable with the accumulator variable in the reduce function. The accumulator accumulates the returned values of the callback functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&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;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for&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;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&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="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// =&amp;gt; count = 20 &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="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;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&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;reduced&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// =&amp;gt; accumulator= 2; arrayVal = 3  &lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; accumulator= 5; arrayVal = 4  &lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; accumulator= 9; arrayVal = 5  &lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; accumulator= 14; arrayVal = 6  &lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; reduced = 20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Common mistake when using reduce for the first time
&lt;/h2&gt;

&lt;p&gt;The results of both snippets above are the same, but there are some important differences. Take a look at the next snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&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;reduced&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;accumulator&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 

 &lt;span class="c1"&gt;// =&amp;gt; accumulator = 2; arrayVal = 3 &lt;/span&gt;
 &lt;span class="c1"&gt;// =&amp;gt; accumulator = 5; arrayVal = 4&lt;/span&gt;
 &lt;span class="c1"&gt;// =&amp;gt; reduced = 23&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Wait, what happened? The mathematicians noticed immediately: 'This isn't right'. When you take a look at the callback function this is what you expected:&lt;br&gt;  2 * 3 = 6 &lt;br&gt; 6 + 3 * 3 = 15 &lt;br&gt;  15 + 4 * 3 = 27. &lt;br&gt; &lt;br&gt;&lt;br&gt;
But value of the variable 'reduced' is 23... Why? More tears...! When you take a look at the console.logs of the callback function it's becoming clear that the callback function isn't executed for the first value in the array. The reduce function takes that first arrayValue as the initial value, which gives the following calculation: &lt;br&gt;
&lt;br&gt; 2 + 3 * 3 = 11 &lt;br&gt;&lt;br&gt;
11 + 4 * 3 = 23&lt;br&gt; &lt;br&gt;&lt;/p&gt;

&lt;p&gt;Okay, fine, when I really have to accept that for the first arrayValue the callback function is not executed, I will accept it. But sometimes you want the callback function to be executed for &lt;strong&gt;every&lt;/strong&gt; value in the array. &lt;/p&gt;
&lt;h2&gt;
  
  
  InitialValue to the rescue
&lt;/h2&gt;

&lt;p&gt;In that case you are able to use the initialValue of the reduce function, as is shown in the snippet below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&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;reduced&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;accumulator&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&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;// =&amp;gt; accumulator = 0; arrayVal=2&lt;/span&gt;
 &lt;span class="c1"&gt;// =&amp;gt; accumulator = 6; arrayVal=3  &lt;/span&gt;
 &lt;span class="c1"&gt;// =&amp;gt; accumulator = 15; arrayVal=4  &lt;/span&gt;
 &lt;span class="c1"&gt;// =&amp;gt; reduced = 27&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Do you see what has changed? In the code above there is a zero after the callback function; the initialValue. Now the callback function is invoked three times as you would expect. &lt;br&gt;&lt;br&gt;
0 + 3 * 2 = 6 &lt;br&gt;&lt;br&gt;
6 + 3 * 3 = 15 &lt;br&gt; &lt;br&gt;
15 + 4 * 3 = 27 &lt;/p&gt;

&lt;p&gt;So when should you use the initial value? If you want to iterate over each value in the array with a callback function, where the callback function not only includes adding up the arrayValue with the accumulator, then you should use the inital value. &lt;/p&gt;
&lt;h2&gt;
  
  
  Why and how to use index
&lt;/h2&gt;

&lt;p&gt;There's one more important issue to address. Sometimes you want to execute different calculations for each value in the array. &lt;br&gt;
For example: you want to multiply each of your arrayValues with the index of the arrayValue. In the classic for-loops you were able to do this: &lt;code&gt;myArray[i]&lt;/code&gt;. With the reduce function you are able to use the optional index value, which can be used as shown in the snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;myArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&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;reduced&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;accumulator&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;arrayVal&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;i&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;// =&amp;gt; accumulator = 0   arrayVal = 2   i = 0&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; accumulator = 2   arrayVal = 3   i = 1&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; accumulator = 5   arrayVal = 4   i = 2&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; reduced = 13&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;See, that's it. &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reduce iterates over each value of an array, and reduces it to a single value.&lt;/li&gt;
&lt;li&gt;Reduce is useful for for example calculating the average, finding the biggest number or the longest word in an array.
&lt;/li&gt;
&lt;li&gt;The accumulator accumulates the returned values of the callback functions. &lt;/li&gt;
&lt;li&gt;The callback function is not executed for the first value of the array.&lt;/li&gt;
&lt;li&gt;When you want the callback function to execute for every value in the array and you want the reduce function to start with a specific value: use the optional initial value of the reduce method. &lt;/li&gt;
&lt;li&gt;Use the index when the array order matters to the logic. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bonus 1:  Figure out why the first example doesn't need an initial value. &lt;br&gt;&lt;br&gt;
Bonus 2:  Try it yourself. I already gave some examples in the codepen which you can alter. &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/RhodeZ/embed/wvwVddP?height=600&amp;amp;default-tab=js&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>reduce</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
