I'd like to understand how to appropriately create a Hash of Arrays of Objects.

In this example, I have a deck of cards (I've omitted some cards to shorten the example):

```
var deckOfCards = [
  {color: "red", coat: "hearts", id: "Ace", faceValue: "A"},
  {color: "black", coat: "clubs", id: "Ace", faceValue: "A"},
  {color: "red", coat: "diamonds", id: "Ace", faceValue: "A"},
  {color: "black", coat: "spades", id: "Ace", faceValue: "A"},
  {color: "red", coat: "hearts", id: "Two", faceValue: "2"},
  {color: "black", coat: "clubs", id: "Two", faceValue: "2"},
  {color: "red", coat: "diamonds", id: "Two", faceValue: "2"},
  {color: "black", coat: "spades", id: "Two", faceValue: "2"},
  {color: "red", coat: "hearts", id: "Three", faceValue: "3"},
  {color: "black", coat: "clubs", id: "Three", faceValue: "3"},
  {color: "red", coat: "diamonds", id: "Three", faceValue: "3"},
  {color: "black", coat: "spades", id: "Three", faceValue: "3"},
  {color: "red", coat: "hearts", id: "Jack", faceValue: "J"},
  {color: "black", coat: "clubs", id: "Jack", faceValue: "J"},
  {color: "red", coat: "diamonds", id: "Jack", faceValue: "J"},
  {color: "black", coat: "spades", id: "Jack", faceValue: "J"},
  {color: "red", coat: "hearts", id: "Queen", faceValue: "Q"},
  {color: "black", coat: "clubs", id: "Queen", faceValue: "Q"},
  {color: "red", coat: "diamonds", id: "Queen", faceValue: "Q"},
  {color: "black", coat: "spades", id: "Queen", faceValue: "Q"},
  {color: "red", coat: "hearts", id: "King", faceValue: "K"},
  {color: "black", coat: "clubs", id: "King", faceValue: "K"},
  {color: "red", coat: "diamonds", id: "King", faceValue: "K"},
  {color: "black", coat: "spades", id: "King", faceValue: "K"}
];

```

I now define different Hashes that I want to use for grouping of cards...

```
var hashOfCardsByColor = [];
var hashOfCardsByCoat = [];
var hashOfCardsById = [];
var hashOfCardsByFaceValue = [];

```

As I iterate through the deck of cards, I'd like to:

1. Check to see if the hash key exists before trying to place the card in the hash and, if the key does not exist, create it.
2. Place the card into an array of cards that can be accessed by that key.

My code... 

```
  deckOfCards.forEach(function(d, i){
    // Handle coats...
    if (d.coat == "hearts") {
      // 1. If "hearts" key doesn't exist, create it and push card onto Array that it points to
      // 2. If "hearts" key does exist, just push card onto Array that it points to
    }
    else if (d.coat == "clubs") {
      // 1. If "clubs" key doesn't exist, create it and push card onto Array that it points to
      // 2. If "clubs" key does exist, just push card onto Array that it points to
    }
    else if (d.coat == "diamonds") {
      // 1. If "diamonds" key doesn't exist, create it and push card onto Array that it points to
      // 2. If "diamonds" key does exist, just push card onto Array that it points to
    }
    else (d.coat == "spades") {
      // 1. If "spades" key doesn't exist, create it and push card onto Array that it points to
      // 2. If "spades" key does exist, just push card onto Array that it points to
    }      
  });

```

I'm struggling with the syntax and code for steps 1 and 2 in the body of each segment, above, and appreciate any help you can offer.

Also, is a "Hash of Arrays" the right description of the above or is it a "Hashmap", for example?