Which fix removes the bug?
async function load() {
const rows = await db.query();
}
console.log(load().length);
- Return
rowsand awaitload() - Remove
asyncfrom the function - Wrap the call in
Promise.all - Read
.lengthinsideload
load() returns a promise with no value; it must return rows and be awaited.
Play Problem Solving ▸