Skip to content

Instantly share code, notes, and snippets.

@mariozig
Created January 18, 2013 02:06
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 mariozig/4561746 to your computer and use it in GitHub Desktop.
Save mariozig/4561746 to your computer and use it in GitHub Desktop.
parallel assignment discussed here: http://ruby.zigzo.com/2013/01/16/parallel-assignment/
var1, var2 = [1, 2] # var1 = 1; var2 = 2
var1, var2 = 1, 2 # var1 = 1; var2 = 2
var1, var2 = 1 # var1 = 1; var2 = nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment