title: Convert javascript array to object of same keys/values
body: <p>I have a function that returns an array, as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/SbssN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SbssN.png" alt="enter image description here"></a></p>
  
  <p>But I'm trying to populate a SweetAlert2 dialog.</p>
  
  <p><a href="https://limonte.github.io/sweetalert2/" rel="noreferrer">As the documentation exemplifies</a>, the desired input would look like this</p>
  
  <pre><code>inputOptions: {
      'SRB': 'Serbia',
      'UKR': 'Ukraine',
      'HRV': 'Croatia'
    },
  </code></pre>
  
  <p>How could I convert my array to the needed format, considering that the key will be the same as the value?</p>
  
  <p>So, something like this would be the result:</p>
  
  <pre><code>{
      'aaa123': 'aaa123',
      'Açucena': 'Açucena',
      'Braúnas': 'Braúnas',
      [...]
  }
  </code></pre>
  
  <p>I have tried <code>JSON.stringify</code>, but the output is not what I need:</p>
  
  <blockquote>
    <p>"[["aaa123","Açucena","Braúnas","C.
    Fabriciano","gege","gegeq2","Ipatinga","Joanésia","Mesquita","Rodoviário","teste","teste2","Timóteo","Tomatoentro","ts"]]"</p>
  </blockquote>