Mega Code Archive

 
Categories / Ruby / Array
 

Store text strings as well as numbers in arrays

array = ["Hello", "there", "AAA", 1, 2, 3] puts array[1]       #prints "there" puts array[4]       #prints 2