Skip to content

Instantly share code, notes, and snippets.

@failshell
Last active August 29, 2015 14:22
Show Gist options
  • Save failshell/fcda156a72c587255838 to your computer and use it in GitHub Desktop.
Save failshell/fcda156a72c587255838 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
f1 = ['foo', 'bar', 'potato']
f2 = ['foo', 'foobar', 'bar']
puts f1.concat(f2).uniq.inspect
puts f1.zip(f2).flatten.compact.uniq.inspect
foo = f1 + f2
puts foo.uniq.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment