Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenmothersele/ddb80cf8924dd71ef7e351bbec514188 to your computer and use it in GitHub Desktop.
Save darrenmothersele/ddb80cf8924dd71ef7e351bbec514188 to your computer and use it in GitHub Desktop.
Util function to create rows into objects
// Util function converts rows to objects
// const labelRows = ([labels, ...data]) => {
// return data.reduce((result, item) => {
// result.push(labels.reduce((object, key, i) => {
// object[key] = item[i];
// return object;
// }, {}));
// return result;
// }, []);
// };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment