hi buddy, when we are using: async function(....) { return await ..... },
should we add Promise or not? (like below):
async func(....): Promise {
return await ......
}
Hey, yea it's good too if you explicitly define the return type of the function. You can pass down a generic type argument to Promise as well so you don't accidentally return a different type of data and that might cause bugs to your code.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi buddy, when we are using: async function(....) { return await ..... },
should we add Promise or not? (like below):
async func(....): Promise {
return await ......
}
Hey, yea it's good too if you explicitly define the return type of the function. You can pass down a generic type argument to
Promise
as well so you don't accidentally return a different type of data and that might cause bugs to your code.