I need to create multiple objects where I have one array of keys to go to multiple different sets of values. I have gotten to the point where I can set the keys to the correct data, but I don't know how to assign each set of key/value pairs to an object. I would need something like object(i) for each object created
function toJSON() {
let temp = {};
let temp2 = [];
let temp3 = [];
for (let i = 0; i < values.length; i++) {
for (let j = 0; j < key.length; j++) {
temp = {
[key[j]]: values[i][j],
}
temp2.push(temp)
}
//Then take this info and put it into an object
}
console.log(temp2)
}