<?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: laryken</title>
    <description>The latest articles on DEV Community by laryken (@laryken).</description>
    <link>https://dev.to/laryken</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%2F853725%2F3f8df8b2-35a3-43ed-8ebb-0d3fa732db45.png</url>
      <title>DEV Community: laryken</title>
      <link>https://dev.to/laryken</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laryken"/>
    <language>en</language>
    <item>
      <title>What am i missing please. it doesn't give me the total. it only evaluates the first if</title>
      <dc:creator>laryken</dc:creator>
      <pubDate>Tue, 26 Apr 2022 12:25:48 +0000</pubDate>
      <link>https://dev.to/laryken/what-am-i-missing-please-it-doesnt-give-me-the-total-it-only-evaluates-the-first-if-5cld</link>
      <guid>https://dev.to/laryken/what-am-i-missing-please-it-doesnt-give-me-the-total-it-only-evaluates-the-first-if-5cld</guid>
      <description>&lt;p&gt;`function inventoryScore (inventory) {&lt;br&gt;
    const splited = inventory.split(',')&lt;br&gt;
    let totalInventory = 0&lt;br&gt;
    for (let i = 0; i &amp;lt; splited.length; i++) {&lt;br&gt;
        const item = splited[i]&lt;br&gt;
        if (item === 'gold cup') {&lt;br&gt;
            totalInventory += 5&lt;br&gt;
        } else if (item === 'puppy') {&lt;br&gt;
            totalInventory += 4&lt;br&gt;
        } else if (item === 'magic cup') {&lt;br&gt;
            totalInventory += 10&lt;br&gt;
        } else if (item === 'tooth of a magestic whale') {&lt;br&gt;
            totalInventory += 20&lt;br&gt;
        } else if (item === 'tentacle of a giant squid') {&lt;br&gt;
            totalInventory += 100&lt;br&gt;
        } else if (item === 'anything else') {&lt;br&gt;
            totalInventory += 1&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
return totalInventory;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;console.log(inventoryScore('gold cup, puppy, magic cup, tooth of a magestic whale, tentacle of a giant squid, anything else'))&lt;/p&gt;

&lt;p&gt;// let str = 'gold cup, puppy, magic cup, tooth of a magestic whale, tentacle of a giant squid, anything else'`&lt;/p&gt;

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