Hello
public data:Array<any> = [
{"id":10, "text": "First"},
{"id":11, "text": "Second"},
{"id":12, "text": "Third"},
{"id":10, "text": "Fourth"},
{"id":11, "text": "Fifth"},
{"id":13, "text": "Sixth"}
];
public array: any[][] = [];
for(let i: number=0;i<this.data.length;i++){
this.array[this.data[i].id] = this.array[this.data[i].id] || [];
this.array[this.data[i].id].push(this.data[i].text);
}
this.array.forEach(element => {
console.log(element);
});
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteAuthorized apple service center in Chennai | apple service center in chennai | Authorized apple service center in Chennai | apple service center in chennai | Mobile service center in chennai | iphone water damage service
ReplyDeleteGood day. I was impressed with your article. Keep it up . You can also visit my site if you have time. Thank you and Bless you always.
Outsource Angularjs Application Development in India