Today I Learned Notes to self about software development

    Array#sample accepts an argument

    TIL you can pass an argument to Array#sample to return more than one random element.

    [1,2,3,4,5,6].sample     # => 4
    [1,2,3,4,5,6].sample(3)  # => [2, 4, 5]
    [1,2,3,4,5,6].sample(-3) # => ArgumentError: negative array size
               [].sample     # => nil
               [].sample(3)  # => []
    
    #ruby #array