When you're learning a new programming language, it is important to see your program's output. This guide can be used in an online REPL environment (like our variable lesson) or in the Unix Terminal by typing irb, which will open an interactive Ruby session.
Printing to the Ruby console
Using puts
In this lesson, we are going to learn the different options available to print messages to the Ruby console. The first way is to use the puts method. Consider this example:
puts "A string"
The preceding line will display the content, A string.
Using p
Another...