title: javascript create dictionary from array
body: <p>I have an array like this</p>
  
  <pre><code>propertiesToCheck: [
      {name: 'name', type: 'type', enabled: true},
      {
          name: 'name2',
          type: 'type2',
          templateUrl: 'something.html',
          preferences: {
              places: [place1, place2,...],
              placesDict: ????
          },
          enabled: true
      }
  ]
  </code></pre>
  
  <p>In the <code>places</code> array there are objects with id, name, etc. Now I want to create a dictionary <code>placesDict</code> that should look like <code>{place1.id: 0, place2.id: 0, ...}</code>, so all values will be set to 0. How can I do that?</p>