Must all functions which return a Promise
be defined as async
?
Until now, I was only defining as async
the functions which take use of await
... But I have seen people that also declare this function as async:
const getPeople = () => {
return db.getPeople(); // A Promise
}
Like this:
const getPeople = async () => {
return db.getPeople();
}
Why?