Skip to content

Instantly share code, notes, and snippets.

@ivanbrennan
Created September 26, 2013 19:16
Show Gist options
  • Save ivanbrennan/6719158 to your computer and use it in GitHub Desktop.
Save ivanbrennan/6719158 to your computer and use it in GitHub Desktop.
Simple array
favorite_foods = ['chicken', 'rice', 'peach', 'nectarine', 'zuchini']
most_fav_food = favorite_foods[2]
puts most_fav_food
colors_of_rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
red, orange, yellow = colors_of_rainbow[0..2]
empty_arr = []
empty_arr[1] = "b"
empty_arr[5] = "f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment