18/19 Blocks


#1

Add a block after .each that multiplies each item by itself and puts the result to the console.

my_array = [1, 2, 3, 4, 5]

my_array.each

dont under stand this "slow learner"


#2

Hi Aspet,

After my_array.each, you need to iterate over the array somehow. An example loop would be:

users.each do |user|
  puts user.name
end

Try seeing if you can go off of that, and let me know if you need any more help.


#3

yeah Thank you :smile: it made it


#4

Hi I am trying to pass this but am having major probs!!!!

Here is my code:

my_array = [1, 2, 3, 4, 5]

my_array.each
users.each do |user|
'puts' user.name
end

Here is what happens when I try to save & submit:

"Oops, try again. It looks like your syntax isn't quite right. Check the Hint if you need help!"

Not sure what to do....the hint has not helped me at all...just got me more confused! Any suggestions would be greatly appreciated! Thankyou in advance!


#5

@samg2015 Please create a new topic and @mention me (@zystvan) in it so I know about it, and I'll help you over there :)