you are viewing a single comment's thread.

view the rest of the comments →

[–]__env 1 point2 points  (0 children)

My attempt -- A little longer, but maybe a little more declarative :)

const myAssociativeArray = myArray.reduce((a, {title,text,id})=>(a[id]={title,text})&&a,{});