<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Computer Science on dev notes</title>
    <link>https://juhanakristianblog.netlify.app/tags/computer-science/</link>
    <description>Recent content in Computer Science on dev notes</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 06 Jul 2021 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://juhanakristianblog.netlify.app/tags/computer-science/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Convert an array to a map in JavaScript</title>
      <link>https://juhanakristianblog.netlify.app/posts/convert-an-array-to-a-map-in-javascript/</link>
      <pubDate>Tue, 06 Jul 2021 00:00:00 +0000</pubDate>
      <guid>https://juhanakristianblog.netlify.app/posts/convert-an-array-to-a-map-in-javascript/</guid>
      <description>&lt;p&gt;Sometimes it&amp;rsquo;s useful to convert a array to a map for convenience or performance reasons. But how can we achieve that so that the resulting code will be easy to understand?&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m using the term &lt;strong&gt;map&lt;/strong&gt; here to mean a data structure where a value can be accessed using an unique key. In JavaScript, objects can be used as maps but there also exists a special &lt;strong&gt;Map&lt;/strong&gt; &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map&#34;&gt;type&lt;/a&gt; which has some advantages and disandvantages when compared to using objects. We won&amp;rsquo;t be covering &lt;strong&gt;Map&lt;/strong&gt; in this article.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
