- The
array.filter
method which is a higher order function which means it takes a function as it's argument.
const someArray = ['😁', '💀', '💀', '💩', '💙', '😁', '💙'];
const getUniqueValues = (array) => (
array.filter((currentValue, index, arr) => (
arr.indexOf(currentValue) === index