Ruby: Newline and Indentation
What does newline mean in Ruby?
- Newline or semicolon is used to separate expressions.
p(3);is the same as
p(3)on a line by itself.
What does indentation mean in Ruby?
- Indentation (tabs or spaces) has no meaning.
Function Argument's Parentheses May be Omitted
- Parentheses for function/method's arguments are often optional. e.g.
p(3)is the same as
(Tip: this is similar to Perl)