When node.js adds the same key value to each idiom in the array, it will use asynchronous function to take the value, resulting in unsuccessful assignment

  node.js, question
rows.forEach(function(row, index) {
 row.count = getCount();
 });

Since getCount is executed asynchronously, the rows array does not add the key count, so how do I make the rows array add the key count uniformly?

It is asynchronous, of course, use back the function or promise;;

javascriptrows.forEach(function(row, index) {
 getCount(function(count){
 rows.count = count;
 console.log(rows.count)
 });
 });
 function getCount(callback){
 var count=1;  //Write 1 here as an example only
 if(callback){
 setTimeout(function(){
 callback(count);
 },1000);
 bracket
 bracket