I have an application that creates a playlist of videos and returns them in json format, the video ID is the "key" and then it has video information attached to it. The video ID is not sequential, "1234", "4234", "123", "5454" are possible IDs, among others.
I have a button for switching the next video, the problem is I don't know how to get the next item in the array unless I loop through the entire array which seems very inefficient. I'm using jQuery so if there's a function available that'd be excellent.
A summary of my question: How do I efficiently select the next item in an array using jQuery/javascript?