$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · hard · #140

Which fix removes the bug?

async function load() {
  const rows = await db.query();
}
console.log(load().length);
  1. Return rows and await load()
  2. Remove async from the function
  3. Wrap the call in Promise.all
  4. Read .length inside load
load() returns a promise with no value; it must return rows and be awaited.
Play Problem Solving ▸