ASYNC and AWAIT - clarification

Hey everyone,

Just a question on ASYNC and AWAIT

https://www.codecademy.com/paths/web-development/tracks/webdev-intermediate-javascript/modules/asynch-js/lessons/async-await/exercises/writing-async-functions

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.

Hi!

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!);
}

getBeans();

Any clarification is much appreciated.
Ty all!