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

231
Views
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
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!