title: In a JS array of objects, should I use a keys to identify each object?
body: <p>I'm still learning javascript patterns, and I'm curious about this one.</p>
  
  <p>If I have an array of objects, should I make the array of objects not have keys (Example A), or use their keys (Example B)?</p>
  
  <p>An array of objects without any key:</p>
  
  <pre><code>var soylent_green_candidates = [{
    id: 12341,
    name: "Don",
    gender: "Male",
    weapon_of_choice: "Kangaroo Cannon"
  },
  {
    id: 24325,
    name: "Jimmy",
    gender: "Male",
    weapon_of_choice: "Sushi Blaster"
  },
  ...
  ]
  </code></pre>
  
  <p>Or an array of objects using the unique ID's as keys:</p>
  
  <pre><code>var soylent_green_candidates = [ 
  12341: {
    name: "Don",
    gender: "Male",
    weapon_of_choice: "Kangaroo Cannon"
  },
  24325: {
    name: "Jimmy",
    gender: "Male",
    weapon_of_choice: "Sushi Blaster"
  },
  ...
  ]
  </code></pre>