diff --git a/base/multidimensional.jl b/base/multidimensional.jl index e85400ebd355a..fb50624abe322 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -1302,11 +1302,14 @@ end hash(x::Prehashed) = x.hash """ - unique(itr[, dim]) + unique(A::AbstractArray[, dim::Int]) + +Return an array containing only the unique elements of `A`, as determined by +[`isequal`](@ref), in the order that the first of each set of equivalent elements +originally appears. + +If `dim` is specified, return unique regions of `A` along dimension `dim`. -Returns an array containing only the unique elements of the iterable `itr`, in -the order that the first of each set of equivalent elements originally appears. -If `dim` is specified, returns unique regions of the array `itr` along `dim`. ```jldoctest julia> A = map(isodd, reshape(collect(1:8), (2,2,2))) diff --git a/base/set.jl b/base/set.jl index 38665b5f55d94..0d19af6e20437 100644 --- a/base/set.jl +++ b/base/set.jl @@ -123,8 +123,9 @@ const ⊆ = issubset """ unique(itr) -Returns an array containing one value from `itr` for each unique value, -as determined by [`isequal`](@ref). +Return an array containing only the unique elements of collection `itr`, +as determined by [`isequal`](@ref), in the order that the first of each +set of equivalent elements originally appears. ```jldoctest julia> unique([1; 2; 2; 6])