How to use one object to assign a value to another object in es6? Please see the following statement

let arra = {
    "aaa":"",
    "bbb":"",
    "ccc":""
}
let arrb = {
    "aaa":"111",
    "bbb":"222",
    "ccc":"333",
    "ddd":"444",
    "eee":"555"
}
listAssign(arra,arrb)

after executing listAssign, arra becomes

arra = {
    "aaa":"111",
    "bbb":"222",
    "ccc":"333"
}

that is, using B object to assign a value to An object
I would like to ask: how should this listAssign be implemented?


const listAssign = (arrA, arrB) => Object.keys(arrA).forEach(key => { arrA[key] = arrB[key] || arrA[key]});

function listAssign(arra, arrb){
      let b = {}
      for(let item in arrb) {
        console.log(item)
        if (Object.keys(arra).includes(item)) {
          b[item] = arrb[item]
        }
      }
      return b
    }

  

Object.assign (a, b)

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