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

207
Views
tratando de hacer que una matriz obtenga nuevos valores a través de la función, luego devuélvalo como global
var doc = document; var k; var array1 = []; var select = doc.getElementById("select"); var select = doc.getElementById("select"); var divP = doc.getElementById("poeng" ); var divH = doc.getElementById("helse" ); var runder = doc.getElementById("rundeQ"); var form1 = doc.getElementById("form1" ); form1.onsubmit = function(evt){ evt.preventDefault() Window.k = array1.push("yay") } console.log(k)

lo que está viendo es un intento de hacer una matriz global que agregue nuevos valores en función, quiero usar este valor más tarde, por lo tanto, intento que ese nuevo valor de matriz esté disponible globalmente para las siguientes funciones, es decir, hacerlo globalmente. algún consejo de cómo puedo hacer que funcione? Entonces, la cosa es que quiero tener varios botones que devuelvan a través de la función, a una matriz global. entonces puedo usar el último valor de cada vez

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

var doc = document; var k; var array1 = []; var select = doc.getElementById("select"); var select = doc.getElementById("select"); var divP = doc.getElementById("poeng" ); var divH = doc.getElementById("helse" ); var runder = doc.getElementById("rundeQ"); var form1 = doc.getElementById("form1" ); form1.onsubmit = function(evt){ evt.preventDefault() window.k = array1; } console.log(k)

Puede usar el objeto de window para esto. No use window.k = array1.push(value); Porque push() devuelve la longitud de la matriz de resultados.

about 4 years ago · Santiago Trujillo 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!