title: Javascript: using date as array key doesn't work
body: <p>I have a list of simple objects that include date and I need to group them by the date.
  Unfortunately it doesn't seem to work.</p>
  
  <p>Here is simplified code:</p>
  
  <pre><code>games = [
      {date:"3/5/17", name:"game 1, 3"},
      {date:"3/5/17", name:"game 2, 3"},
      {date:"4/5/17", name:"game 3, 4"},
      {date:"4/5/17", name:"game 4, 4"},
      {date:"4/5/17", name:"game 5, 4"},
      {date:"5/5/17", name:"game 6, 5"},
      {date:"5/5/17", name:"game 7, 5"},
  ]
  
  let games_by_date = []
  
  games.map( (i)=&gt;{ 
      if(!games_by_date[i['date']]) 
      games_by_date[i['date']]=[]; 
    games_by_date[i['date']].push(i);
  } )
  
  console.log(games_by_date)     // shows [3/5/17: Array[2], 4/5/17: Array[3], 5/5/17: Array[2]], but shows it as Array[0]
  console.log(games_by_date[0])  // undefined
  console.log(games_by_date[1])  // undefined
  
  games_by_date.map( (g)=&gt;console.log(g) )  // doesn't even gets there
  </code></pre>
  
  <p>If I do the same but use a different column, it's working correctly.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>games = [
   {date:"3/5/17", day:"3", name:"game 1, 3"},
   {date:"3/5/17", day:"3", name:"game 2, 3"},
   {date:"4/5/17", day:"4", name:"game 3, 4"},
   {date:"4/5/17", day:"4", name:"game 4, 4"},
   {date:"4/5/17", day:"4", name:"game 5, 4"},
   {date:"5/5/17", day:"5", name:"game 6, 5"},
   {date:"5/5/17", day:"5", name:"game 7, 5"},
  ]
  
  let games_by_date = []
  
  games.map( (i)=&gt;{ 
   if(!games_by_date[i['date']]) 
     games_by_date[i['date']]=[]; 
    games_by_date[i['date']].push(i);
  } )
  
  console.log(games_by_date)
  console.log(games_by_date[0])
  console.log(games_by_date[1])
  
  games_by_date.map( (g, d)=&gt;console.log(d, g) )
  
  console.log("--------------------")
  
  let games_by_day = []
  
  games.map( (i)=&gt;{ 
   if(!games_by_day[i['day']]) 
     games_by_day[i['day']]=[]; 
    games_by_day[i['day']].push(i);
  } )
  
  console.log(games_by_day)
  console.log(games_by_day[0])
  console.log(games_by_day[1])
  
  games_by_day.map( (g, d)=&gt;console.log(d, g) )</code></pre>
  </div>
  </div>
  </p>
  
  <p>So it seems to happen because of the type of keys I'm using.</p>
  
  <p>Did you come across it and how did you solved it?
  Thanks</p>