DEV Community

Sahil Gadimbayli
Sahil Gadimbayli

Posted on

3 2

Get last returned value in the console

It happens that when we are working on the console we need to make use of last return value. It is also annoying when we forget to assign it to a variable to make use of it and have to type/copy it all over again.

When this happens, we can conveniently use underscore _ to retrieve the last return value.

$ irb

['I am last returned array']
_
['I am last returned array']
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay