How to merge the corresponding parts of two object values in js

clipboard.png

clipboard.png

Mar.05,2021

you have to work hard!

//  obj 
let obj2 = Object.keys(obj).map(k => {
  return {
    name: obj[k],
    value: obj1[k]
  };
});

try the following code:

let a = { "a":"name", "b":"value"}
let b = { "a":123, "b":456}

let c={}
for (var key in a) {
    if (a.hasOwnProperty(key)) {
        console.log(key + " -> " + a[key]);
        console.log(b[key]);
        c[a[key]] =  b[key];
    }
}

console.log(c);

will output: "

a -> name
123
b -> value
456
{ name: 123, value: 456 }
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-1b3cd10-2c327.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-1b3cd10-2c327.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?