I think there are two things that might be happening:
let titles = {}
this.user.titles.forEach(title => {
let key = title.year_id
const item = {
id: title.id
en: title.en
}
if(!titles[key]) {
titles[key] = []
}
titles[key].push(item)
})
return titles
If you want to copy all props for a title you can use this instead:
const item = { ...title }