I'm learning ruby on rails. Often there is this nil at the end of my output why is this how can i prevent this showing up in the result?
When you were running your code in a real ruby environment this should not happen. Ruby console shows you the value of last statement. Since your print statement doesn't return a value it defaults to "nil".
Thank you Ms Gloria good and important to know this wont happen in a real ruby environment.
You also said since my print statement doesn't return a value it defaults to nil. Below i uploaded a picture of the ruby course part i'm with at the moment, wen i run the code the puts statements outputs text so its not empty but still there is this nil showing up why is this?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.