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

How do you produce a modified copy of a Data instance, and what happens to the original?

Point = Data.define(:x, :y) pt = Point.new(3, 4) pt2 = pt.with(x: 6) # pt == ? pt2 == ?