I need to extract and combine two values from an Interface:
export interface CurrenciesList {
currency: string;
country: string;
}
The initial mapping looks like this:
this.optionValues["currency"] = value.map(i => ({ id: i.currency, name: i.currency }));
However, I want to merge the values like this:
this.optionValues["currency"] = value.map(i => ({ id: i.currency, name: i.currency - i.country }));
Instead of getting the desired result, I only get 'And'. Ideally, I would like the output to be listed as:
USD - United States
What is the correct way to map the following expression: name: i.currency - i.country