const arr = ['a','b','c','c','b','d','a']
let result = arr.filter(function(value, index, array) {
    console.log( array.indexOf( value ) + ' : ' + index );
})

//"0 : 0"
//"1 : 1"
//"2 : 2"
//"2 : 3"
//"1 : 4"
//"5 : 5"
//"0 : 6"

const arr2 = ['a','b','c','c','b','d','a']
let result2 = arr2.filter(function(value, index, array) {
    return array.indexOf( value ) === index
})
console.log(result2); // ["a","b","c","d"]

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.