It's not a Ruby method, it's an irb (Ruby interactive prompt or REPL) shortcut for the result of the last evaluated expression. _ doesn't have such a meaning in a regular Ruby program.
Hey Dmitry. Yep you are absolutely right! The _ expression cannot be used in regular Ruby programs. I'll update the post to add a clarifying statement about this point. Thanks!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.