unique

Creates unique array retaining first occurrence of elements.

A compare function is optional (default is ===).

Example