When to use puts, print, and p in Ruby
Usually, programming languages have methods for printing out variables. Ruby is not an exception. We will explore the 3 popular methods for printing variables in the Ruby Programming language. The print method The way print(var) works is basically converting its value to a string by calling the to_s method on the object(everything is an object in Ruby) before printing the value and returning nil to its caller. num = 123 print(num) # -> 123 => nil The print method can be easily used for concatenating strings...