jQuery function to get all unique elements from an array?