does anyone know why the last promise is not saved in the const variable?
const customer = await getCustomer(1);
console.log('Customer: ', customer);
if (customer.isGold) {
const movies = await getTopMovies();
console.log('Top movies: ', movies);
await sendEmail(customer.email, movies);
console.log(‘Email sent…’);
}
getCustomer, getTopMovies are saved into the const variable and then console.log
But for sendEmail, if you do the same, it returns undefined