node.js +对象键值附加

在我的节点应用程序我运行2 sequelize查询和获取2对象数组作为输出。 现在我必须从第二个对象数组中追加1个键值到第一个。

考虑以下是2对象数组:

1st [{"id_0":56, "id_1":67, "staterank":32}, {"id_0":87, "id_1":97, "staterank":5} ] 2nd array: [{"id_0":56, "id_1":67, "countryrank":140}, {"id_0":87, "id_1":97, "countryrank":400} ] The array needed by me: [{"id_0":56, "id_1":67, "staterank":32 "countryrank":140}, {"id_0":87, "id_1":97, "staterank":5 "countryrank":400} ] 

我尝试了以下代码:

 2ndarray.forEach(function(countryelem){ 1sttarray.forEach(function(stelem){ console.log("countryelem=" + util.inspect(countryelem)); stelem.countryrank = countryelem.country_rank; }) }) 

但我正在接受coumtrycode为“1”,这是第二arrays的最后一项。请帮我解决这个问题。