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

117
Views
¿Por qué no cambia el valor en la matriz?

¿por qué consola. registrando la matriz con todos ceros?

Claramente estoy cambiando el valor, pero sigue siendo la consola. Registro con solo ceros

 let a = 0, b = 0, c = 0, d = 0, e = 0 f = 0, g = 0, h = 0, i = 0; const test = document.querySelector(".test"); test.addEventListener("click", () => { a = 1; b = 1; c = 1; gameBoard.winConditions; console.log(gameBoard.winConditions) }) const gameBoard = { winConditions: [[a, b, c], [a, d, g], [a, e, i], [b ,e, h], [c, e, g], [c, f, i], [d, e, f], [g, h, i]] }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

gameBoard.winConditions; esta línea no hace nada. Al actualizar las variables a,b,c..., las condiciones de winConditions permanecen igual. Recomendaría escribir una función para volver a evaluar el valor de winConditions :

 let a = 0, b = 0, c = 0, d = 0, e = 0 f = 0, g = 0, h = 0, i = 0; const test = document.querySelector(".test"); test.addEventListener("click", () => { a = 1; b = 1; c = 1; applyWinConditions(); console.log(gameBoard.winConditions) }) const gameBoard = {}; applyWinConditions(); // set the win conditions initially function applyWinConditions() { gameBoard.winConditions = [[a, b, c], [a, d, g], [a, e, i], [b ,e, h], [c, e, g], [c, f, i], [d, e, f], [g, h, i]]; }
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!