[].filter(i => typeof i.number != 'undefined')
var info = [{
desc: 'elem',
number: 10,
}, {
desc: 'elem2',
number: 20,
}, {
sum: 200,
}];
var sum = info.filter(i => i.sum).shift().sum;
var res = info.filter(i => i.number).map(m => {
return {
...m,
percentvalue: (m.number / sum) * 100
}
});
res.push({sum: sum});
console.log(res);