This block isn't about looping. He's creating an empty array that will be used to hold the objects created and passing it into a block of code. Others may choose to just define the array outside the block and rely on Ruby's scope to look outside the block when we shovel objects into the array in line 16 but it's better practice to explicitly pass the array into the block with the .tap do |array|
I learned so much from this video, such a informative video! Thank you Drifting Ruby!
Hi, Really Cool Video Thank's a lot
8:20 at line 13, why didn't you just do "1.times do |array|" ?
Now when I think about it, was it even necessary to have it if it was going to loop one time?
This block isn't about looping. He's creating an empty array that will be used to hold the objects created and passing it into a block of code. Others may choose to just define the array outside the block and rely on Ruby's scope to look outside the block when we shovel objects into the array in line 16 but it's better practice to explicitly pass the array into the block with the .tap do |array|
@@Fig330 Ohhhh, that explains it! Thanks
Amazing stuff
Thank you.
Speed up requests by adding pagination)