title: Performance of array includes vs mapping to an Object and accessing it in JavaScript
body: <p>According to the fundamentals of CS
  the <code>search</code> functionality of an unsorted list has to occur in O(n) time where as direct access into an array will occur in O(1) time for HashMaps.</p>
  
  <p>So is it more performant to map an array into a dictionary and then access the element directly or should I just use includes? This question is specifically for JavaScript because I believe this would come down to core implementation details of how <code>includes()</code> and <code>{}</code> is implemented. </p>
  
  <pre><code>let y = [1,2,3,4,5]
  y.includes(3)
  </code></pre>
  
  <p>or...</p>
  
  <pre><code>let y = {
            1: true,
            2: true
            3: true
            4: true
            5: true
          }
  5 in y
  </code></pre>