What is the difference between Set and Array in Ruby except for the fact that sets keep unique elements while arrays can keep duplicate elements?
Set
Array
They are very different.
a[3]
[1, 'apple', String, 1, :banana]
require 'set'
Set.new
Set[]
Set[1,2,3]
1.4m articles
1.4m replys
5 comments
57.0k users