Answers for "convert array to array of objects'"

6

convert array to object javascript

const convertArrayToObject = (array, key) =>
  array.reduce(
    (obj, item) => ({
      ...obj,
      [item[key]]: item
    }),
    {}
  );
Posted by: Guest on May-05-2020

Code answers related to "convert array to array of objects'"

Code answers related to "Javascript"

Browse Popular Code Answers by Language