Typescript Array Merge Function