unique

Remove duplicate values from a String, Number, or Array.


Syntax


Parameters

  • Mixed subject - The entity to remove duplicate values from.
    • String - The String will be purged of duplicate characters.
    • Number - The Number will be treated as a String.
    • Array - The Array will be purged of duplicate items. Keys are preserved where possible.


Result

  • Mixed - The modified subject.
    • String - If subject is a String or Number.
    • Array - If subject is an Array.

Returns subject with duplicate elements removed.