I have an array in javascript with this structure:
controllers: Array(2)
0: Object
vram: 4095
1: Object
vram: 1024
This array is generated via si.graphics. There can be more sub-arrays with different values.
I need to somehow return just the index of the controller with the most vram. I've found other stack questions about something similar, but seemingly only with flat arrays, but this array is multi-dimensional.
I haven't tried much to accomplish this because I simply do not know where to start.
How can I get the index of the sub-array with the most vram?
This is not a duplicate because it is focusing on getting the highest value itself, which is pretty trivial and is not what I am/was asking for.