object.reduce((acc, item) => (acc[item.id] = item, acc), {}) javascript code example
Example: object.entries reduce
.as-console-wrapper { max-height: 100% !important; top: 0;}
.as-console-wrapper { max-height: 100% !important; top: 0;}