1.

What is the difference between nil and false in Ruby?

Answer»

nil false nil cannot be a VALUE. false can be a value. nil is returned where there is no predicate. 

in case of a predicate, true or false is returned by a method. nil is not a boolean DATA TYPE. false is a boolean data type. nil is an OBJECT of nilclass. false is an object of falseclass. 



Discussion

No Comment Found