Don't miss understand but the way you asked the question is not very clear. So I am working 'backwards' from the example you have given and guess that the starting data structure which I call 'x' is something like:
var x = [
{title:
{id:"a",en:"b"},
year_id:"c"
},
{title:
{id:"_a",en:"_b"},
year_id:"_c"
}
]
Assuming key values are primitives, year_id is unique, you can still use reduce like below, it looks bulky but it is basically a one liner:
var z = x.map(function(d,i){
var obj = {},
key = d.year_id,
objKey = obj[key]={};
objKey.id = d.title.id,objKey.en = d.title.en;
return obj
})
.reduce(function(ac,d,i){
Object.keys(d).forEach(function(dd,ii){
return ac[dd] = d[dd]
});
return ac
},{})
if you console log z:
{
c : { id : "a", en : "b" },
_c : { id: "_a", en: "_b" }
}
Needless to say this is ES5, no need for babel to transpile.