如何编写一个包含两个对象并相互结合的程序?

var fbAcc = {
    "apurba" : "aapurba9",
    "reejan" : "hreejan",
    "kiran" : "kiran901"

};
var redAcc = {
    "apurba" : "phantom9",
    "reejan" : "reejanbroo",
    "suyog" : "seaten69"
};

function combineObj(a, b){

}
combineObj(fbAcc, redAcc);


//Output :
//{
//"apurba" : ["aapurba9", "phantom9"],
//"reejan" : ["hreejan", "reejanbroo"],
//"kiran" : ["kiran901"],
//"suyog" : ["seaten"]
//}

我希望我的CombineObj函数从技术上结合之前的键或字符串为基础的对象。在这种情况下,我希望它返回我在输出中编写它的方式。 那我该怎么办呢?

评论