My web app returns to the user all images in a specific folder (pictures taken for each day in the month) via array of filenames. Issue is that sometimes the number of images are just too many (30-500 images).
What i wanted to do is provide a summary of that array, by reducing that array to just 10 images. I could easily get the first 10 by limiting the loop. But that just represents the first part (for few images of the day) . I wanted to get 10 images from that array in a way that the 10 images is equally spread out throughout the day.
I could think of several ways to do this but involving quite a lot of code.
Was wondering if anyone knows of a cool array function or method that solves this problem?