Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Using Asynchronous, Foreach and arguments.callee

I put **** in some places because the production is too long. my aim is: I don't want it to switch to the 2nd foreach list until all the operations in the 1 foreach list are finished. I used arguments.callee until that element came inside, because when I clicked somewhere on the site where I was going to process, a loading site opened and waited. For the line where I use the item element, it gives the error "Uncaught SyntaxError: Invalid left-hand side in assignment".

var asd = (async()=>{
    var list = ["******","******"];
    list.forEach(async (item) =>  {
        await document.querySelector("******").click();
        await document.querySelector("******").click();
        await document.querySelector("******").click();

        (async function()  {
            if(document.querySelector("*****").className.indexOf("*****") == -1) {
                await document.querySelector("*****").select();
                await document.querySelector("*****").value="name : "+item;
                const event = await $.Event('keyup');
                event.which = 13;
                event.keyCode = 13;
                await $('*****').trigger(event);
            }
            else setTimeout(arguments.callee, 1000);
        })
    })
})
asd();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!