In case anyone is looking for an answer, here's one way to do it:
function bodyCost(body)
{
let sum = 0;
for (let i in body)
sum += BODYPART_COST[body[i]];
return sum;
}
Then use it like so
console.log(bodyCost([WORK, CARRY, MOVE]));