Let's say I have an array like this:
var colors = ['blue', 'red', 'red', 'red', 'blue', 'red', 'blue', 'blue']
How would I get an array that tells me what position each of them is at? for example:
var reds = [1,2,3,5], blues = [0,4,6,7]
So far I have tried to use the indexOf(); function but that will only return 1 of the values if there are multiple matches.