Can I return nothing in ruby?
Just for educational purpose
For example:
myarray = [1,2,3] myarray << some_method def some_method
You can't return "nothing" from a method in ruby. As you point out you could conditionally add elements to your array. You can also invoke .compact on your array to remove all nil elements.