title: Add additiontal values to Map value (key, value) object from RxJs observable call
body: <p>I'm trying to add data to a map api call. I use RxJS to create an observable and want to add this data before subscribing. Even though I can do it after, that means I'll need to subscribe to the data, which is different from how I do the rest of my service providers. </p>
  
  <p>I have an API call, 'site.com/api' with a map data type. For brevity, I'll reduce the data to what matters. It returns a format like Map, see below</p>
  
  <pre><code>interface input {
    name: string;
    month: string;
    season?: string
  }
  
  data = {
    '2020-01-01': {
      name: 'test';
      month: 'Jan';
    },
    '2020-01-02': {
      name: 'hi';
      month: 'Feb';
    }
  }
  </code></pre>
  
  <p>What I want is know is how to map this to add a season. Right now, my code sorta works, but instead of adding a season to each individual map element, it creates a new element entirely. </p>
  
  <pre><code>const req = this.http.get&lt;any&gt;('site.com/api')
        .pipe(
          map((data) =&gt; {
            // Get data keys and associated data key to be all it's current values and add season
            const transformedData = Object.keys(data).map(key =&gt; data[key] = {
              ...data,
              season: 'Summer'
            });
  
            return transformedData;
          }),
  
        );
  </code></pre>
  
  <p>Eg</p>
  
  <pre><code>{
  0: [
      '2020-01-01': {...},
      '2020-01-02': {...},
      'season': 'Summer'
    ]
  1: [
    '2020-01-01': {...},
    '2020-01-02': {...},
    'season': 'Summer'
    ]
  }
  </code></pre>
  
  <p>Which is strange because I thought maps go through each element once, so that code would go through, get the first element's keys and then modify it's value. </p>
  
  <p>Some online answers use pluck to modify map key values, but that implies you know what the key is. My map keys are dynamic and the dates will change, so I can't use that approach. Other examples online aren't map , just an array. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Intended results </p>
  
  <pre><code>{
    '2020-01-01': {
      name: 'test';
      month: 'Jan';
      season: 'Summer';
    },
    '2020-01-02': {
      name: 'hi';
      month: 'Feb';
      season: 'Summer';
    }
  }
  </code></pre>
  
  <p><strong>EDIT</strong>
  I've simply adjusted my other functions to use an array of objects instead of a map . Can someone close this question?</p>