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

141
Views
Convert Nested For Loops to Promise with if conditions in Javascript

Ask: I want to convert below code of nested loops to promise, such that I can wait for all the promises to resolve.

Issue: I can't figure out syntax or approach to write a promise for 3 nested loop in one.

Below is the Code, I am trying to convert to promise. Any help on this is really appreciated:

for (var i of LOOP1) {
        
          for (var j of LOOP2) {
          
            if (LOOP1.length === 1 && !i.code) {
              i.code = j.code;
            }
              
              for (var k of i.UpdatedName) {
                k.name = j.name;
              }
              
              for (var test of i.CommonNames) {
                CommonNames.name = j.name;
              }

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