I have an array like below:
[
{productypeId: 1, producsubtypeId: 1, productid: 1},
{productypeId: 1, producsubtypeId: 1, productid: 2},
{productypeId: 1, producsubtypeId: 2, productid: 3},
{productypeId: 1, producsubtypeId: 2, productid: 4},
{productypeId: 2, producsubtypeId: 5, productid: 6},
{productypeId: 2, producsubtypeId: 5, productid: 7}
]
I want the following output:
[
{productypeId: 1, producsubtypeId: 1, d: '1,2'},
{productypeId: 1, producsubtypeId: 2, d: '3,4'},
{productypeId: 2, producsubtypeId: 5, d: '6,7'}
]
please help me on this Thanks in advance
productTypeIdandproductSubTypeIdalways be the same? I.e. 1. And if they are not the same, what do you want to hapoen?