Returns array with elements unique by key function
Function to generate key for each element
Input array
Array with elements unique by key
Returns array with elements unique by key function