data.risk.scatterIndices.investments.map((el: any) => el.name) || []
I have a mapping function that generates an array like this:
["pension","realestate","balance","kupot"]
This is the condition I want to use to translate this array into a new array:
`
if(key === 'balance'){
key = 'עוש ומזומן'
} else if(key === 'realestate'){
key = 'נדלן'
} else if(key === 'pension'){
key = 'פנסיה'
} else if(key === 'kupot'){
key = 'קופות'
}
`
Expected output:
["קופות","עוש ומזומן","נדלן","פנסיה"]
How can I achieve this?