Created
January 31, 2019 11:01
-
-
Save darrenmothersele/ddb80cf8924dd71ef7e351bbec514188 to your computer and use it in GitHub Desktop.
Util function to create rows into objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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