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

239
Vistas
How do I find the closest value to a value in an array inside of an array?

I was trying to have a grid of positions with a custom x and y value for every space but everything I found was not what I was looking for. This is the array I have:

var Grid = [[[72, 169], [70, 265], [70, 365], [67, 463], [64, 563]],
        [[147, 166], [150, 267], [148, 367], [147, 467], [152, 565]],
        [[229, 167], [229, 267], [231, 372], [231, 466], [235, 561]],
        [[311, 166], [311, 267], [316, 374], [316, 468], [317, 566]],
        [[393, 165], [388, 267], [393, 372], [393, 465], [400, 560]],
        [[475, 165], [475, 269], [474, 376], [472, 464], [477, 560]],
        [[555, 169], [555, 266], [554, 374], [553, 459], [553, 560]],
        [[631, 169], [632, 271], [633, 370], [632, 465], [638, 560]],
        [[711, 175], [720, 270], [719, 368], [726, 459], [724, 552]]];

The outer arrays inside are the columns. The coordinates for each space is inside them. I want to find the closest x and y positions for a given position

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