Skip to content

Instantly share code, notes, and snippets.

@joho
Created March 19, 2009 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joho/81601 to your computer and use it in GitHub Desktop.
Save joho/81601 to your computer and use it in GitHub Desktop.
# can someone please explain this to me?
left = { :a => 'a', :b => 'b' } # => {:a=>"a", :b=>"b"}
right = { :a => 'a', :b => 'b' } # => {:a=>"a", :b=>"b"}
left == right # => true
left.eql? right # => false
left_array = [1, 2]
right_array = [1, 2]
left_array == right_array # => true
left_array.eql? right_array # => true
# which means
[left_array] - [right_array] # => []
[left] - [right] # => [{:a=>"a", :b=>"b"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment