Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Collections Ruby Arrays Ruby Arrays

MICHAEL P
MICHAEL P
5,191 Points

What is the keyboard shortcut that Jason uses to quickly "recall" the array in irb?

In irb, when Jason types the array:

grocery_list = ["milk" , "eggs" , "bread"] and types enter so that the array is stored,

how does he so quickly get the: grocery_list = ["milk" , "eggs" , "bread"] to come up so quickly so that he does not have to reenter grocery_list = ["milk" , "eggs" , "bread" so that he can quickly add the 1 , 2, 3 to the array ? What command do I type on the keyboard? I am using a mac computer. Thank you

4 Answers

Kristi Smythe
Kristi Smythe
10,665 Points

I would also like to know the answer to your question Michael. The up arrow works at the command line but ! in irb.

RubyMine appears to be an excellent tool for working with Ruby irb local on Mac, so if we don't get a working response for this Q it might be a good idea to get comfy with RubyMine local, ie. not doing these tuts in Workspaces. https://www.jetbrains.com/ruby/help/running-irb-console.html

MICHAEL P
MICHAEL P
5,191 Points

I used the Up arrow key also, and it did not work. I correctly typed the array into irb.

Matthew Day
Matthew Day
6,740 Points

The Up arrow key works for me so maybe it's a setting specific to IRB or the version you are using. I'm using rib version 0.9.6(09/06/30)