- Create a variable named
days_of_the_week
as an array of the following:- Sunday
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Remove Sunday from the first postion and move it to the last position. Use array methods.
you can do this programmatically or just type in manually
- The first inner array should be the weekdays
- The second inner array should be the weekend days
Your choice...
Starting with the following array...
remember to test your code and use (irb/pry/p)!
planeteers = ["Earth", "Wind", "Captain Planet", "Fire", "Water"]
Access the second value in planeteers
.
# Your answer here
Add "Heart" to the end of planeteers
.
# Your answer here
Combine planeteers
with rangers = ["Red", "Blue", "Pink", "Yellow", "Black"]
and save the result in a variable called heroes
.
# Your answer here
Alphabetize the contents of heroes
using a method. The Ruby documentation might help.
# Your answer here
Randomize the contents of heroes
using a method. The Ruby documentation might help.
# Your answer here
Select a random element from heroes
using a method. The Ruby documentation might help.
# Your answer here
display each hero
in a new line on the terminal using the .each
method
# Your answer here
display each hero
in a new line on the terminal using the .each
method only if the hero starts with the letter 'W'
# Your answer here