Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubyStruct and DataSingle-choice MCQ

Comparing a Struct-based value object with a Data-based one, which difference is real?

S = Struct.new(:x) D = Data.define(:x) s = S.new(1); s.x = 99 # ? d = D.new(1); d.frozen? # ?