Episode 15 - Arrays


  1. Create an array of 5 pet names.
    Print out only the second pet name.
  2. Run the code below.
    numbers = [3, 2, 7]
    puts numbers[7]
    What's the output? Explain why you got what you did.
  3. Run the code below.
    names = ["Carmen","Bob", "Jenny"]
    puts names.join(", ")
    What does it output? Use the join method again to create a string from the same array, but this time separated by dashes.