Skip to content

Instantly share code, notes, and snippets.

@asifvora
Last active August 31, 2021 09:15
Show Gist options
  • Save asifvora/427eb83bafc35928acd180956359644c to your computer and use it in GitHub Desktop.
Save asifvora/427eb83bafc35928acd180956359644c to your computer and use it in GitHub Desktop.
Async/Await Essentials for Production: Loops
const timeoutPromise = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout));
const list = document.querySelectorAll('.L3NKy');
function clikOnLink(link){
link.click();
}
const asyncLoop = async () => {
for (let i = 0; i < list.length ; i++) {
await timeoutPromise(1000);
clikOnLink(list[i]);
}
}
asyncLoop();
@kanna375
Copy link

Your code work, thank you)

Bro how to use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment