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

160
Views
¿Cómo puedo completar mi matriz en JavaScript dependiendo de la entrada del usuario?

¿Cómo puedo llenar mi matriz según la entrada del usuario en lugar de cambiar esta matriz manualmente en JavaScript?

¿Cómo puedo vincular mi formulario en HTML a mi javaScript?

 let move = ["L", "L", "R", "F", "N"]; let lastElement = move.slice(-1); console.log(lastElement); function finalPosition(move) { let countUp = 0, countDown = 0; let countLeft = 0, countRight = 0; let l = move.length; for (let i = 0; i < l; i++) { if (move[i] == 'F') countUp++; else if (move[i] == 'B') countDown++; else if (move[i] == 'L') countLeft++; else if (move[i] == 'R') countRight++; } document.write("Final Position: (" + (countRight - countLeft) + ", " + (countUp - countDown) + "," + lastElement + ")"); } finalPosition(move);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Bueno, dos preguntas en una:

  • ¿Cómo puedo llenar mi matriz según la entrada del usuario en lugar de cambiar esta matriz manualmente en JavaScript?

    Use .push() para agregar un valor a su Array. Para más información ver aquí .

  • ¿Cómo puedo vincular mi formulario en HTML a mi javaScript?

    1. Agregue una identificación al formulario.

    2. Luego cargue el formulario con:

       const theForm = document.getElementById("theFormId");

      Entonces puedes trabajar con el formulario en JavaScript.

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!