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

183
Views
Do the array update after the function is executed in the array? if not can someone explain me why?

I just wondering if the array is updated after the checking_plus_1 is running

for(let i = array.length-1;i>0;i--){
    if(k < test.length){
        checking_plus_1(combine,array,test[k])
        if(array[i] == 100 && array[i-1] == 100){
            array[i] = array[j];
            array[i-1] = array[j-1];
            array[j] = test[k];
            array[j-1] = test[k];
            combine[j] = test[k];
            combine[j-1] = test[k];
            changeRowtoZero_minus_1(combine,array,i,i-1)
        }
    }
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Despite I don't know your checking_plus_1 function, yes you can mutate your array in your for loop on each iteration.

You can also see the changes by adding console.log(array) in your for loop.

about 4 years ago · Juan Pablo Isaza Report
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!