Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
Object property is showing as true but it's false when I try to do anything with it

I'm trying do make a js chess board, and I only validate the pinned pieces moves, like so:

for (var j = 0; j < moves.length; j++) {
    console.log(this.position[1][moves[j].start])
    console.log(this.position[1][moves[j].start].isPinned)
    if (this.position[1][moves[j].start].isPinned || isInCheck) {
        this.makeMove(moves[j], false);
        // checks if king is in check
        this.unmakeMove(false)
    }
}

The first console.log logs the piece that's trying to move, wich is an object, and if I manually see it's "isPinned" key, it's sometimes true, but even when it is true, the second console.log logs "false". I have no idea what is causing that, maybe some of you guys can help me

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda