New Discussion

Notifications

You’re not receiving notifications from this thread.

Arrays in Ruby Discussion

7
General

That underscore tip is really handy!

Yes! I love that one! :)

I forget about it all the time. Nice to get the reminder! : )

agreed, but what scenario would we use this in?

Any scenario where you want to forgot to save the last thing returned in your console or IRB session to a variable. You can also call methods on _ and they will be sent to whatever the last returned object/result was from your console session.

Indeed, I very much agree with you

The undersore tip is super handy! Will definitely be using this. Thank you!!!

Is there any performance issue when we chain methods? or doesn't it take any impact similar to get return value of one method and again use it to another method and so on?

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 89,392+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.