What is an object? Objects are like "boxes". Therefore, when checking for existence,
Let's look at it from the perspective of.
python
obj.nil?
python
obj.empty?
"The box does not exist or the contents do not exist" By the way, ** Rails-only method **
python
obj.blank?
#Synonymous
obj.nil? || obj.empty?
"There is a box and there are contents" By the way, ** Rails-only method **
python
obj.present?
#Synonymous
!obj.nil? && !obj.empty?
obj.blank?
Recommended Posts