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

An object holds an instance variable pointing to an Array. After d = obj.dup, you push onto d's array. What happens to the original object's array?

class Account attr_accessor :history def initialize; @history = []; end end a = Account.new b = a.dup b.history << "x" p a.history