Accesing 2d arrays from Javascript [closed]

If you don’t know the external indice, you’d have to loop through every element in the array and compare the values of their x/y coordinates to your given coordinates, then return the ID when you find a match, or some sentinel value if you reach the end without finding a match.

Browse More Popular Posts

Leave a Comment