I'm looking for a js/jquery solution for the following
I want to check an array for duplicates, lets say:
var destRes = ['BH17 7EP', 'TA2 6LL', 'OX15 4LJ', 'OX15 4LJ', 'OX15 4LJ', 'BH17 7EP', 'TA2 6LL']
and return an array that holds the first index of that value; for example for the above ex this should be the return:
var newArr = ['0', '1', '2', '2', '2', '0', '1' ]
BH17 7EP is at index 0 and 5, so in the new array the 0 and the 5 indexes should be 0, the first instance of BH17 7EP
TA2 6LL is at index 1 and 6 so in the new array the 1 and the 6 indexes should be 1, the first instance of TA2 6LL