Skip to content

Instantly share code, notes, and snippets.

@doug7410
Last active August 29, 2015 14:02
Show Gist options
  • Save doug7410/99a02989c3b586eb7aca to your computer and use it in GitHub Desktop.
Save doug7410/99a02989c3b586eb7aca to your computer and use it in GitHub Desktop.
Answer to Tea Leaf Academy lesson 1 : make a quiz question
# Question
How can the code below be refactored into one line?
arr = [2,3,4,5]
arr *= 4
arr.shuffle
# Answer
arr = ( [2,3,4,5] * 4 ).shuffle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment