Ox.unique: for string argument, return string

This commit is contained in:
rlx 2016-02-18 10:58:32 +05:30
parent 7f8403d89f
commit 08e16d073c

View file

@ -765,9 +765,10 @@ Ox.unique <f> Removes duplicate values from an array
[1, 2, 3]
> Ox.unique([NaN, NaN])
[]
> Ox.unique('foo')
'fo'
@*/
Ox.unique = function(array) {
array = Ox.slice(array);
return Ox.filter(array, function(value, index) {
return array.indexOf(value) == index;
});