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

95
Views
¿Cómo empujar un nuevo elemento a la matriz existente que tendrá un valor restado 10 del elemento anterior hasta que se acerque a 0 o 0?

Tengo un número que tiene un valor de [200] .

¿Cómo empujar un nuevo elemento a la matriz existente que tendrá un valor restado 10 del elemento anterior hasta que se acerque a 0 o 0?

Estaba pensando en while loop pero no estoy seguro. ¿Alguien puede ayudar a resolver esto por favor?

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

0

Un bucle while funcionará bien:

 const arr = [200] while (arr[arr.length - 1] > 9) { arr.push(arr[arr.length - 1] - 10) } console.log(arr)
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!