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
/** | |
* Converts an Object of Arrays to an Array of Objects | |
* @param {Object} object_arrays An object of arrays where each array is of the same length | |
* @returns {Array<Object>} An Array of objects where each key in each object corresponds to that element in the original array | |
*/ | |
function obj_arraysTOarray_objs(object_arrays){ | |
let final_array = object_arrays[Object.keys(object_arrays)[0]].map( | |
// el is unused, but needs to be defined for map to give access to index i | |
(_el, i) => { | |
let internal_object = {}; |