concise way to build an object from an array of objects
While it technically still would initialize it as an empty object, one could build derivedData with one call to Array.prototype.reduce(). It is similar to forEach() except that the first argument of the callback function is an accumulator variable, that needs to be returned at the end of the function. See the snippet below for a demonstration.


const data = [
  {"period": "2021-05-01", "quantity": "28"},
  {"period": "2021-06-01", "quantity": "42"},
  {"period": "2021-07-01", "quantity": "66"}
];

const derivedData = data.reduce((accumulator, o) =&gt; {
  accumulator[o.period] = o.quantity;
  return accumulator;
}, {});

console.log('derivedData: ', derivedData);



You may find these functional exercises interesting.
Good job using const for variables that don't need to be re-assigned, and using common spacing conventions for modern JavaScript.