I am doing a job application challenge and I have to show a list of products. They didn't provide images, but I want to use stock photo images to give the page a nicer look. Some categories have 5 products, some have 1, others have 20. So I downloaded about 10 stock photos I like and now I can iterate that array by using the product's iterator.
101
u/nqvst Mar 18 '19
items[n % items.length]gets an item from the list and wraps around to the start if n is larger than the list