title: Change array in javascript into simpler object
body: <p>I have a simple JSON with an array that contains further objects, etc. like this:</p>
  
  <pre><code>languagePack:
  [
    {
      'key': 'Username',
      'value': 'Benutzername',
      'group': 'default'
    },
    {
      'key': 'Password',
      'value': 'Passwort',
      'group': 'default'
    }
  ]
  </code></pre>
  
  <p>But what I really want is an object like this:</p>
  
  <pre><code>languagePack: 
  {
      'Username': 'Benutzername',
      'Password': 'Passwort'
  }
  </code></pre>
  
  <p>So, I want to reduce the array to simple key-value-pairs that are inside an array or even an object (keys are unique). Does anyone have an idea how to reduce this with some of these cool array functions? I only came up with something like an for each and building the object "by hand" property for property, but  I remember there were some cool things for array like 'reduce', the spread operator (...), map, every, some, etc.</p>
  
  <p>I tried it with something like:</p>
  
  <pre><code>var temp = this.languagePack.map(([key, value]) =&gt; ({key,value}))
  console.log(temp)
  </code></pre>
  
  <p>But that only got me an error message <code>TypeError: Invalid attempt to destructure non-iterable instance</code> </p>
  
  <p>Edit: All three answers are working perfectly fine. Thanks.</p>