My approach to storing objects for a grid involves using a two-dimensional array. In this case, the grid is hexagonal, making it more convenient to utilize a coordinate system centered at (0, 0) and ranging from -r to r.
The following source suggests that negative indices in an array are not actual indices, but rather properties of the array itself.
Here are my two concerns:
Will the speed of operations performed on the array be affected by this? Can negative indices still be accessed in constant time?
How can I remove negative indices? My attempt using splice resulted in deleting incorrect indices (as seen below).