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

140
Views
Decrement loop in javascript

I'm trying to run this loop

var max_number= $("input[name='max_number']").val(); 
var min_number= $("input[name='min_number']").val(); 

for(var j=max_number;j>=min_number;j--)
{  
  console.log('j value' + j);
}

max_number is 10 & min_number is 8 then for loop is not executing when i change it to j=max_number-1

for(var j=max_number-1;j>=min_number;j--)
{  

    console.log('j value' + j);
}

but i want to start it with max_number

i want that loop should be executed like this :

if max_number is 12 and min number is 2 Output :

12 11 10 9 8 7 6 5 4 3 2

Any solution, Thanks

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!