Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubydup vs cloneSingle-choice MCQ

A singleton method is defined on an object, which is then copied. What is printed?

obj = Object.new def obj.special; "hi"; end puts obj.dup.respond_to?(:special) puts obj.clone.respond_to?(:special)