Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Arrays uniq elements

  • uniq
  • uniq!
names = ["Foo", "Bar", "Foo"]
puts names.uniq
puts names
puts names.uniq!
puts names
["Foo", "Bar"]
["Foo", "Bar", "Foo"]
["Foo", "Bar"]
["Foo", "Bar"]