Skip to content

Instantly share code, notes, and snippets.

@shinokada
Created May 1, 2014 02:27
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 shinokada/11443352 to your computer and use it in GitHub Desktop.
Save shinokada/11443352 to your computer and use it in GitHub Desktop.
# 1.
a = [1, 2, 3]
b = [1, 4, 3]
a.zip(b).map { |x, y| x == y } # [true, false, true]A
# 2.
a.zip(b).collect {|x,y| x==y }
# => [true, false, true]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment