what is wrong with the code below alphabet = ["a", "b", "c"] alphabet << "d"
HI, I'll say nothing.. what error do you get?
I get the following error:
Oops, try again.
Make sure to replace .push with <<!
and only this output: "A giraffe surrounded by weezards!"
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..
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!"
I found that for some weird reason the issue is with the commented code. When I remove the commented code it works