[DOC] Additional to Array#sample [ci skip]

* The requirement to the +n+ argument.
* The order of the result array.  [Misc #14147]
This commit is contained in:
Nobuyoshi Nakada 2021-09-22 14:08:05 +09:00
Родитель 13bb16f41e
Коммит f8bf766877
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7CD2805BFA3770C6
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -49,6 +49,8 @@ class Array
# But +self+ may contain duplicates: # But +self+ may contain duplicates:
# a = [1, 1, 1, 2, 2, 3] # a = [1, 1, 1, 2, 2, 3]
# a.sample(a.size * 2) # => [1, 1, 3, 2, 1, 2] # a.sample(a.size * 2) # => [1, 1, 3, 2, 1, 2]
# The argument +n+ must be a non-negative numeric value.
# The order of the result array is unrelated to the order of +self+.
# Returns a new empty \Array if +self+ is empty. # Returns a new empty \Array if +self+ is empty.
# #
# The optional +random+ argument will be used as the random number generator: # The optional +random+ argument will be used as the random number generator: