Group elements of array of objects Js : <p>I've been trying to group elements with the same values in the array for hours but I'm going nowhere </p>

<p>Array:</p>

<pre><code>list = [
    {id: "0", created_at: "foo1", value: "35"},
    {id: "1", created_at: "foo1", value: "26"},
    {id: "2", created_at: "foo", value: "13"},
    {id: "3", created_at: "foo1", value: "11"},
    {id: "4", created_at: "foo", value: "11"},
    {id: "5", created_at: "foo1", value: "16"},
    {id: "6", created_at: "foo", value: "26"},
    {id: "7", created_at: "foo1", value: "13"},
    {id: "8", created_at: "foo1", value: "16"}
];
</code></pre>

<p>The result I'm trying to get is:</p>

<pre><code>var result = [
    [
        {id: "0", created_at: "foo1", value: "35"}
    ],
    [
        {id: "1", created_at: "foo1", value: "26"},
        {id: "6", created_at: "foo", value: "26"}
    ],
    [
        {id: "2", created_at: "foo", value: "13"},
        {id: "7", created_at: "foo1", value: "13"}
    ],
    [
        {id: "3", created_at: "foo1", value: "11"},
        {id: "4", created_at: "foo", value: "11"}
    ],
    [
        {id: "5", created_at: "foo1", value: "16"},
        {id: "8", created_at: "foo1", value: "16"}
    ]         
];
</code></pre>

<p>any ideas how to get that?  thanks in advance.</p>

<p>Note: I'm working with angular 5.</p>
