The problem of js traversing two object arrays to form a new object

the data structure of exConfig is as follows:

exConfig:[{
        exConfigName:"1",
        exConfigKey:"itemCode1"
      },
      {
        exConfigName:"3",
        exConfigKey:"itemCode2"
      },
      {
        exConfigName:"4",
        exConfigKey:"itemCode3"
      },
      {
        exConfigName:"6",
        exConfigKey:"itemCode4"
      }]

the structure of the data1 object is as follows:

data1:{
      itemCode:"900001",
      itemCode2:"900002",
      itemCode3:"900003",
      itemCode4:"900004"
    }

the structure of the data2 object is as follows

data2:{
      itemCode:"900001",
      itemCode2:"900002",
      itemCode3:"900003",
      itemCode4:"900004"
    },

ask how to write a traversal loop if you want to get the following data structure

exConfig:[{
        exConfigName:"1",
        exConfigKey:"itemCode1",
        data1:{
          itemCode:"900001"
        },
        data2:{
          itemCode:"900001"
        }
      },
      {
        exConfigName:"3",
        exConfigKey:"itemCode2",
        data1:{
          itemCode2:"900002"
        },
        data2:{
          itemCode2:"900002"
        }
        
      },
      {
        exConfigName:"4",
        exConfigKey:"itemCode3",
        data1:{
          itemCode3:"900003"
        },
        data2:{
          itemCode3:"900003"
        }
      },
      {
        exConfigName:"6",
        exConfigKey:"itemCode4",
        data1:{
          itemCode4:"900004"
        },
        data2:{
          itemCode4:"900004"
        }
      }]
Mar.10,2022

  MDN Array map  learn the usage of  map , accept an anonymous function, and return a converted array 

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-1b3f408-40a06.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-1b3f408-40a06.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?