ASYNC and AWAIT - clarification

Hey everyone,

Just a question on ASYNC and AWAIT

Why does shopForBeans() run in this case when it’s onlyn been assigned to value?
I understand what takes place but more so trying to really understand why things happen the way they do.


We can’t actually see the code. If you post your example here people can opine :slight_smile:

Oh wow apologies for that.

I thought I was supposed to just put a link to the exercise.

Below is the code:

const shopForBeans = require(’./library.js’);

async function getBeans() {
console.log(1. Heading to the store to buy beans...);
let value = await shopForBeans();
console.log(3. Great! I'm making ${value} beans for dinner tonight!);


Any clarification is much appreciated.
Ty all!