Javascript – Find all pairs of indexes in an array

Given an array such as

['a', 'b', 'c', 'd', 'e', 'a', 'c'],

am I able to find all pairs of indexes for a given “start” and “end” index.

Therefore, the above array would return the pairs [0, 2] and [5, 6] for the start character ‘a’ and the end character ‘c’. There can be one to many pairs.

I know I can get the indexes of all ‘a’ and all ‘c’ in separate lists: a = [0, 5], c = [2,6] and then grab the first item of each list and so forth, but was curious if it was possible to get the indexes at the same time.

Thanks!