Js array operation

let arr1 = ["a","b","c"];
let arr2 = ["d","e","f"];

how to become

let arr3 = [{"key1":"a","key2":"d"},{"key1":"b","key2":"e"},{"key1":"c","key2":"f"}];
May.05,2021

let arr3 = arr1.map((item,index)=>({
    key1:item,
    key2:arr2[index] || ''
}))

var arr1 = ['a','b','c'];
var arr2 = ['d','e','f'];
let arr3 = arr1.map(function(val,index)=>{
    return {'key1':val,'key2':arr2[index]};
});

is the data structure always the same length?
for fault-tolerant processing, it is recommended to compare the length of two arrays in advance, and then cycle the array with large length to avoid data loss.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b364de-2c019.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b364de-2c019.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?