This is something I have never quite been able to nail down.
Consider an async function in Typescript. Which is correct?
async function asyncFunctionOne(string1: string, string2: string, string3: string) {
var returnObject1 = new object {
fieldOne: object1,
fieldTwo: object2,
fieldThree: object3
}
return Promise.resolve(returnObject1)
}
async function asyncFunctionTwo(string1: string, string2: string, string3: string) {
var returnObject2 = new object {
fieldOne: object1,
fieldTwo: object2,
fieldThree: object3
}
return returnObject2;
}
Additionally, consider we were calling this function and we needed the response for something further in our program. Would we need to await the first function, the second function, both, or neither?