After adding a new entry, I want to check and remove duplicates from the list of things that have been added. So on the Add Field/added attribute, I call a method to simply remove any duplicates:
function removeDups<T>(array: T[]): T[] {
return [...new Set(array)];
}
// this.aliases = removeDups(this.aliases);
The assignment (commented out) is of type Alias array (a business object)…so the question is, how do I case the returned array back to the business object type?