title: assigning a key name from an array
body: <p>I can't seem to make the key equal to the name of the index value of the array of names being passed in.</p>
  <p><strong>What Im trying to do:</strong></p>
  <p>create a key value of names and numbers to keep track of how many duplicate names I have.</p>
  <p><strong>input/output:</strong></p>
  <p>names = [bob, joe, jill, bob, bill, bill]</p>
  <p>the output would be {bob:2, joe:1, jill:1, bill:2}</p>
  <p>I haven't gotten to this part of the code yet. currently just trying to get the keys right. But it should paint a picture of what I'm trying to do.</p>
  <p><strong>the Issue I'm having:</strong></p>
  <p>I cant seem to create keys for each name in my set</p>
  <p><strong>what I did initially:</strong></p>
  <p><code>myset.add({names[i]:0})</code></p>
  <p>which I changed to a variable called <code>keyname</code> that is being assigned right under my forloop.</p>
  <p>this changed nothing.</p>
  <hr />
  <pre><code>function solution(names) {
      const myset = new Set();
      for(let i=0; i&lt;names.length; i++){
          let keyname = names[i];
          if(myset.has(names[i])){
              console.log(&quot;already includes&quot;);
          }
          else(
              myset.add({
                  keyname:0
              })
          )
      }
      console.log(myset);
  }
  </code></pre>
  <hr />
  <p><strong>Console:</strong></p>
  <pre><code>Set(5) {
    { keyname: 0 },
    { keyname: 0 },
    { keyname: 0 },
    { keyname: 0 },
    { keyname: 0 }
  }
  </code></pre>