javascript async await returns undefined

Solutions on MaxInterview for javascript async await returns undefined by the best coders in the world

showing results for - "javascript async await returns undefined"
Damián
05 Jan 2020
1async function getLikes() {
2  const likes = await db.get('myLikes'); // this db method returns a Promise
3  // ...
4  return likes; // will return a Promise resolving likes from db or an error if there is one
5}
6
7async function logLikes() {
8  const result = await getLikes();
9  console.log(result);
10}
11