I've always found this to be a tricky concept to fully grasp.
Let's delve into async functions in Typescript. Which implementation is accurate?
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;
}
Furthermore, let's imagine we're utilizing these functions and require the response for further processing within our application. Should we await the first function, the second function, both, or neither?