Merge Arrays of Objects in TypeScript (concat, spread, by id)
To merge two arrays in TypeScript, use concat() or spread syntax: a.concat(b) and […a, …b] both return a new array and leave the originals alone. That is all you need when the rows are independent. When both arrays hold objects that describe the same records, you usually want one row per id instead of two, … Read more >>