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

158
Views
cycle FOR stops in the middle p5.js

I am doing this to clean the array theClouds = [];

function removeClouds(obj){
    var index = theClouds.indexOf(obj);
    if ( index > -1){
        theClouds.splice(index, 1);
        console.log(theClouds.length);
    }
}

function deleteClouds(){
    for (let u = 0; u < theClouds.length; u++){
        theCloud = theClouds[u];
        removeClouds(theCloud);
    }
}

But for some reason the loop stops in the middle, removes one or two and then ignore the rest, i have to click on the button that activates de function deleteClouds to force the loop and remove everything.


I forgot to mention, but theClouds[] is an array of arrays, I dont know if that concludes the same so theClouds = [ the.cloud = [x,y, image]]

Doing this will have the same point?
function deleteClouds(){
  theClouds = [];
    }
}
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!