const money = ['eur 10', 'usd 1', 'usd 10', 'rub 50', 'usd 5']
let res = new Map()
for (var i=0, len=money.length; i<len; i++) {
let valuta = money[i].split(' ')
if(res.has(valuta[0])){
let price = res.get(valuta[0])
res.set(valuta[0], price + Number(valuta[1]))
}
else{
res.set(valuta[0], Number(valuta[1]))
}
}
console.log(res);