ecmascript 6 - JavaScript Reduce Array of objects to object dictionary - Stack Overflow

PHOTO EMBED

Sun Oct 23 2022 15:44:44 GMT+0000 (Coordinated Universal Time)

Saved by @arielvol #javascript

this.filters = this.filters.reduce((result, filter) => {
    result[filter.name] = filter.value;
    return result;
},{});
//-^----------- here
content_copyCOPY

https://stackoverflow.com/questions/37706471/javascript-reduce-array-of-objects-to-object-dictionary