Answers for "object to array keys"

1

es6 array to object keys

const subLocationTypes = (location.subLocationTypes || []).reduce((add, cur) => {
add[cur.key] = cur.value;
return add;
}, {});
Posted by: Guest on October-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language