I\'m trying to strip the duplicate array values from my current array. And I\'d like to store the fresh list (list without duplicates) into a new variable.
var
you forgot to use return statement in the filter call
return
filter
const namesArr = duplicatesArray.filter(function(elem, pos) { return duplicatesArray.indexOf(elem) == pos; });