Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const brainstormDinner = require('./library.js')
- // Native promise version:
- function nativePromiseDinner() {
- brainstormDinner().then((meal) => {
- console.log(`I'm going to make ${meal} for dinner.`);
- })
- }
- nativePromiseDinner();
- // async/await version: (Will produce the exact same result as the native promise)
- async function announceDinner() {
- // Write your code below:
- let meal = await brainstormDinner(); //create a variable to hold the resolved value of the promise returned from brainstormDinner()
- console.log(`I'm going to make ${meal} for dinner.`); //Then we can write our console.log()
- }
- announceDinner();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement