Skip to content

Instantly share code, notes, and snippets.

@meaganewaller
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save meaganewaller/f398436a299818d2649d to your computer and use it in GitHub Desktop.

Select an option

Save meaganewaller/f398436a299818d2649d to your computer and use it in GitHub Desktop.
Ruby Basics: Arrays
array = []
#=> []
array = Array.new
#=> []
array = [1, 2, 3]
#=> [1, 2, 3]
array = Array.new(3)
#=> [nil, nil, nil]
array = ["Meagan", 1, nil, true]
#=> ["Meagan", 1, nil, true]
array = Array.new(["Meagan", 1, nil, true])
#=> ["Meagan", 1, nil, true]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment