I am not sure if I missed it, but Jay does not explain why the call to puts is returning that empty value?
Why did the call to puts at 9:16 return an empty value? Jay just said it did, but did not explain why.
I think I get it now: is it because the method put does not return a value in general, so there is no value to be assigned to the variable number? So the correct way would have been not to use puts in the content of the subtract method, right?
Lukasz Walczak6,619 Points
number = 9 puts number number = subtract(number,1) # value of the 'number' should be nil, not 8 imho puts number # prints 8 to the console puts number.class # class is nil
so if the variable 'number' is nil why will it still print a value (8 in this case) to the terminal? if nil is absence of the value, where the value is coming from then?