#Java script
14 messages · Page 1 of 1 (latest)
that will depend on how deep you get into it. for a shallow understanding for at least know how to use it, it should take even less than 1 hour
Thanks
In it's simplest terms
use it when the function requires to wait for data that could be delayed
-# think of api or database calls
for a more in depth explanation
JavaScript is single threated meaning it can at best use 1 core of the cpu
this is a performance issue because that means it wouldn't be able to multi task
to solve this issue they created "asynchronous" so it can rapidly switch tasks back and fourth
as this is the closest thing to multi tasking on a single threat
"async" is basically just a flag telling JS to expect data it needs to wait on
while "await" is just a flag telling JS "go do something else but come back once in a while for any data" but really fast
Thank you
Btw, is the guide for node.js and express.js 4 years ago still relevant?
Not really sure what guide you refer to but doubt things drasticly changed that much compared to now so you should be in the clear for most things
Sorry but cant help to notice things like this usually are expected from you to know this before working or learning a back-end in node as this will be used verry often
As database and api calls are huge portion of this
You're still welcome and we are ready to help but this is a huge leap people usually learn to swim in water that is less deep
Take it slow and steady you dont learn everything in a day and dont need to either
I just ran into this video yesterday. It's pretty good explanation why JavaScript has async functions (with await) or rather it explains why they are even a thing.
Learn how the browser event loop, task queue, microtask queue, and Web APIs work together to enable non-blocking, asynchronous JavaScript.
- https://www.patreon.com/LydiaHallie
- https://buymeacoffee.com/lydiahallie
- https://twitter.com/lydiahallie
- https://www.linkedin.com/in/lydia-hallie/
- https://instagram.com/theavocoder
Timestamps:
0:...
Thank you !!
Yeeee I've seen this video, it's cool
Thanks