Being pushy


#1



what is wrong with the code below

alphabet = ["a", "b", "c"]
alphabet << "d"


#2

HI, I'll say nothing.. what error do you get?


#3

I get the following error:

Oops, try again.
Make sure to replace .push with <<!

and only this output: "A giraffe surrounded by weezards!"


#4

Hi you should do the same for that

caption = "A giraffe surrounded by "
caption += "weezards!" # Me, too!

if you also did that try to post all your code..


#5

The exercise asks to do the following:

Update the code in the editor to use the concatenation operator instead of .push and +.

and the hint says:
All you need to do is replace .push and + with <<. Ruby makes everything easy!

and I am trying the following:

alphabet = ["a", "b", "c"]

alphabet.push("d") # Update me!

alphabet << "d"

caption = "A giraffe surrounded by "

caption += "weezards!" # Me, too!

caption << "weezards!"


#6

I found that for some weird reason the issue is with the commented code. When I remove the commented code it works