Js data structure organization

data structure to be implemented: const data = [{.}, {.},.];

//  arrays
arrays = [[1,2,3],[4,5,6],[7,8,9],[10,11,12]];
// key keys
keys = ["a","b","c"];

question: how to combine the above data into the following form?

data = [{a:1,b:2,c:3},{a:4,b:5,c:6},{a:7,b:8,c:9},{a:10,b:11,c:12}];
Mar.09,2022

The values in the

keys array must be written as follows: keys = ['a', 'baked,' c'] , otherwise, a

is the variable of a _
data = arrays.map(arr => {
    let item = {}
    arr.forEach((value, index) => {
        item[keys[index]] = value
    })
    return item
})

if such a structure can be guaranteed

arrays.map(item => {
    let rt = {}
    keys.forEach((key, idx) => {
        rt[key] = item[idx]
    })
    return rt
})

anyway, I already have the answer upstairs, so I, a rookie, will write an es5 to practice.

for (var i = 0; i < arrays.length; iPP) {
  var obj = {};
  for (var j = 0; j < keys.length; jPP) {
    obj[j] = arrays[i][j];
  }
  data.push(obj);
}

 var data = arrays.map(item => {
        const obj = {};
        for(let i = 0; i < keys.length; iPP){
           obj[keys[i]] = item[i];
        }
       return obj;
     })
Menu