title: Generating Entries with Same Name in JavaScript Object
body: <p>I'm new to Javascript and I've done a little research but I can't seem to figure out how to generate multiple lists with same name keys but different values. I'm trying to generate code for an embed message which should look something like this:</p>
  
  <pre><code>{embed: {
      color: 3447003,
      title: "title",
      description: "desc",
      fields: [{
          name: "header 1",
          value: "text 1"
        },
        {
          name: "header 2",
          value: "text 2"
        },
        {
          name: "header 3",
          value: "text 3"
        }
      ]
    }
  }
  </code></pre>
  
  <p>this is for generating a list of my commands in an embed automatically so I don't have to keep going back and edit it.</p>
  
  <p>I'm mainly trying to get multiple of the "fields" with the "name" and "value" entries and also trying to add all the commands in a line for the "value".</p>
  
  <p>Here's my code:</p>
  
  <pre><code>let currentCategory = "";
      var embed = {
        "title": "= __Command List__ =",
        "description": `[Use ${message.settings.prefix}help &lt;commandname&gt; for details]`,
        "color": 2563607,
        fields : []
      };
      const sorted = myCommands.array().sort((p, c) =&gt; p.help.category &gt; c.help.category ? 1 :  p.help.name &gt; c.help.name &amp;&amp; p.help.category === c.help.category ? 1 : -1 );
      sorted.forEach( c =&gt; {
        const cat = c.help.category.toProperCase();
        if (currentCategory !== cat) {
          embed.fields = [{name : `${cat}`,value : ""}];
          currentCategory = cat;
        }
        embed.fields[0].value += ` \`${c.help.name}\``;
      });
      console.log({embed});
      message.channel.send({embed});
  </code></pre>
  
  <p>I used <code>console.log({embed});</code> to print the code it generates in the console and this is what shows.</p>
  
  <pre><code>{ embed:
     { title: '= __Command List__ =',
       description: '[Use y!help &lt;commandname&gt; for details]',
       color: 2563607,
       fields: [ [Object] ] } }
  </code></pre>