This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function someFunction() { | |
const myArray = [1, 2, 3]; | |
const connection = mysql.createPool({ options }); | |
let finalArray = []; | |
myArray.forEach((value) => { // standard forEach | |
finalArray.push(asyncFunction(connection, value).then((result) => { | |
finalValue.asyncFunctionValue = result.asyncFunctionValue; // giving instructions | |
return finalValue; // important to return the value | |
})); | |
}); |