I have an array with the items duplicated, say for eg:
var arr = [1,2,3,4,4,4,5,6]
arr.indexOf(4) => 3 always gives me the first index of the duplicated element in the array.
What is the best approach in finding the index of other duplicated element especially the last one?
lastIndex...?