merge array typescript code example
Example 1: angular append array to another
this.results = [ ...this.results, ...data.results];
Example 2: merge two types typescript
interface IStudent {
id: string;
age: number;
}
interface IWorker {
companyId: string;
}
type IStudentAlias = IStudent;
type ICustomType = IStudent | IWorker;
let s: IStudentAlias = {
id: 'ID3241',
age: 2
};