Skip to content
Advertisement

Tag: async-await

Why doesn’t .then() need the async keyword when used (similar to await)? How does Javascript know it’s an asynchronous operation?

I’m starting to learn asynchronous Javascript and I’m really confused. To be honest, the async/await approach seems very logical to me. We need to let the runtime know we’re doing an asynchronous operation so it can handle it accordingly. But why don’t we need to do the same when using the .then() method? I mean, if Javascript was already able

How does variable setting work with await?

Can someone explain to me why this is not working the way I am expecting? I am expecting the last console.log to run after my functions run, but it is returning empty length string instead of the actual date. These are the variables I want to set after my function call. Declaring them now so the scope is set globally.

Then Vs Await issue

You dont have to read the code, what is happening is a file is being uploaded 1000 bytes at a time. And to ensure that we send the bytes in order we are using await. What if I wanted to use .then(), it seems hard as there is a loop around the fetch call. Answer Here is the same functionality

Using async await in Cypress

I’m very new in Cypress and I’m trying to take a value from an element to use after in the test, but I can’t manage to get the value. Someone said that I need to use async await, but it is not working or maybe I’m doing something wrong. Thanks in advance! Answer You can use aliases and save the

Advertisement